How to create (realtime) line in unity....

i want users to be able to create line, when user clicks and Drag mouse… line should begin at the object on which we clicked, and should end at mouse up position… it should be 3d… or like a cylinder with very short radius… line should be linked with the parent object in addition…

Here is an UA answer that should get you started: [http://answers.unity3d.com/questions/492786/draw-an-arrow-on-the-screen.html][1] [1]: http://answers.unity3d.com/questions/492786/draw-an-arrow-on-the-screen.html

1 Answer

1

You will need to make a LineRenderer: Unity - Scripting API: LineRenderer

You can then set the beginning and end points of the line through script to get it to link to the object and the mouse. If this is 3D you will need a way of deciding where the “Z” of the mouse is within the scene.

Thank you sir!!! i got my solution because of you!! :)