Drawing a line between 2 things

How would I draw a line between 2 points

Like a harpoon shooter and the harpoon connected by a line?
So I have this cube called string. Uh… now what do I do? :frowning:

You can draw lines using a Raycast. Check the tutorials for Raycast. But the thing you’re trying to achieve here is different. You need an actual model of a cable or wire, so that it can be connected to the harpoon…

You could use a line renderer. Just redraw the line each frame.

ok how do i made a line renderer? :open_mouth:

Raycasting does not include any mechanisms for drawing lines.

By using the fancy new API documentation - http://docs.unity3d.com/ScriptReference/LineRenderer.html

Line Renderer (easiest method)

or use GL

As its a rope you may want to produce a rope effect with hinges etc … see asset store products like:

line Rendering; it has a pinkish square that rotates when i move my camera, so, what now? :confused:

How do I script it so it connects 2 points? I got dis so far

It’s uh. not working

Line renderer works by, setting a material, texture, to define what it loos like, colour included. Also, you can define its two points. Each end. So, up date each end as needed.

Oh it worked, but it just wasnt in world space xD ty