I'm trying to use an immediate mesh since that looks like a much better solution, but I'm finding some problems. This is the code I'm using to generate the mesh:
func update(end: Vector3) -> void:
var start: Vector3 = global_position + Vector3(0.0, 0.5, 0.0)
var trail: Vector3 = end - start
var direction: Vector3 = trail.normalized()
var distance: float = trail.length()
var dir90: Vector3 = direction.rotated(Vector3.UP, TAU/4)
var thickness: float = 4.0
var points: int = 3
mesh.clear_surfaces()
mesh.surface_begin(Mesh.PRIMITIVE_TRIANGLE_STRIP)
for i in range(0, points + 1):
var x: float = float(i) / float(points)
var d: Vector3 = (x * distance) * direction
mesh.surface_set_normal(Vector3.UP)
mesh.surface_set_uv(Vector2(0.0, x))
mesh.surface_add_vertex(start + d + (thickness * dir90))
mesh.surface_set_normal(Vector3.UP)
mesh.surface_set_uv(Vector2(1.0, x))
mesh.surface_add_vertex(start + d - (thickness * dir90))
mesh.surface_end()
Nothing at all shows. In some positions I get a very buggy gray rectangle, but most of the times I don't get anything at all:

However, if I use a LINE_STRIP instead of a TRIANGLE_STRIP, the lines are drawn correctly, showing the correct positions of all the points and the triangles they should be creating:

The idea is to draw a plane from the capsule in the image to the white circles. The lines show that it is more or less what I want, but I can't understand why TRIANGLE_STRIP just draws something completely different with the same vertex positions.