How do I draw a line from an object to a raycast intersection?

How do I…

I’m trying to draw bullet lines for a shooter I’m making. So I need to shoot a ray from the gun and get the position of the intersections and use that position to draw a line from the object to the intersection.

What is the actual result

The line ends up drawing from intersection back to (0, 0) for some reason and I can’t find the problem. See the screenshot of the relevant code below:

Related screenshots