Create 3D lines

This seems remarkably over-complicated. A line is defined by two points. So you need two points, each defined by a Vector3. Then a thickness for the line.

But all that SurfaceTool stuff is overkill and not really performative. It also clearly doesn’t work. This is the problem with LLMs. They lie. They are not good at math. They are just reconstructing things that other people wrote. They do not actually know anything.

You have two options:

  1. Continue vibe coding. Just feed it back into the LLM, tell it your problem and see what it comes up with. Vibe coding is about learning how to communicate with an LLM what you need until you learn how to get it. It is not unlike being a project manager talking to human developers.
  2. Learn how to do it yourself. It may be a learning curve, but understanding how it works is going to help you out when you have a problem going forward. If you want to take this approach, read on.

This is one of those times where computer programming requires some math. I recommend you read this part of the docs.

Then, all you need to do is get the distance between your two points, add a MeshInstance3D to your scene, and a CylinderMesh and make it as long as your two points, as thick as you want, move it to your first point, and rotate it towards your second.