- Home /
Arc line between two objects in world space
I would like to draw an arc line between two objects in world space (as a visual cues). The arc should be depending on the position of the camera - so that the line is always be visible.
Do you know any tutorials or code snippets which would be helpful for this approach?
Thank you in advance.
Answer by Captain_Pineapple · Jan 29, 2019 at 12:32 PM
Hey there,
i guess the most basic solution would be a Line Renderer Component It allows for basic straight lines or advanced curves by setting line points by script. The manual reference above is already straight forward i think. If you plan on creating lines by script you should further look into this scripting api reference for the line renderer setposition function.
It will help you understand the basic script wise creation of lines.
Hope this points you in the right direction. If you happen to have further questions regarding this feel free to ask.
Answer by katjavvvv · Jan 30, 2019 at 09:07 AM
Heyhey @Captain_Pineapple
Thank you for your answer.
Now I have a line between my two objects. My goal is that the users can follow the line with his/her eyes from the start object to the goal object without moving his position. So the line should make a bow/arc around the camera (in a decent distance) to the goal object.
Hey there,
as I stated in my answer you can provide additional points between start and goal which the linerenderer will pass. Can you clarify your issue a bit more? Do you have problems calculating the points? Or setting them? What should the line look like? (curved?, edges?)
Your answer
Follow this Question
Related Questions
Line renderer length 1 Answer
Line Renderer in World Space 2 Answers
reset Line Renderer every second 0 Answers
Draw an arc around a sphere 2 Answers
Raycasting, How to draw a line to the position of the rays end when nothing is hit 1 Answer