- Home /
Answer by MazDev · Apr 15, 2015 at 12:10 PM
Good Morning :)))
Finally I find the solution in this post :))) http://answers.unity3d.com/questions/370846/bezier-style-laser.html
I would thank this man Seth Bergman very much to saving my life :)))
Answer by hbalint1 · Apr 13, 2015 at 08:46 PM
With a custom LineRenderer. http://docs.unity3d.com/Manual/class-LineRenderer.html
thank you for reply
I looked but im not finding what im searching, can you give me more information or example
you have two object. you want to draw a line between them. I recommend line renderer because you can use your own texture on it with width (so it's not just a thin line). Here is an example i found:
lineRenderer.SetPosition(0, new Vector3(objectOne.transform.position.x,objectOne.transform.position.y,objectOne.transform.position.z));
lineRenderer.SetPosition(1, new Vector3(objectTwo.transform.position.x,objectTwo.transform.position.y,objectTwo.transform.position.z));
But it can be simplified i think:
public GameObject firstObject;
public GameObject secondObject;
lineRenderer.SetPosition(0, firstObject.transform.position); // set the starting point of the line
lineRenderer.SetPosition(1, secondObject.transform.position); // set the ending point of the line
if you want to draw lines with a broke in it, you can just add a third poistion maybe and so on..
my problem is not drawing lines, im drawing it but i trying to add it some effect or animated ... i dont now how to make it :( thank you for the help
oh sorry. I misunderstood the question. SO try this: https://www.youtube.com/watch?v=1HHcHkAwyNU around 49:00. I tried it and it works. it's rotating the linerdenrer around it's axis. So if you'd like some spiral effect just draw some lines in 45°to the texture. If you'd like some more complex thing you can use this: https://www.youtube.com/watch?v=OUq2fsL-gRs or you can play with particle system for more beautiful result. In my project I used trail renderer with particle system. It's really nice :)
i think the second video can resolve my problem, i'm going to try animatedTextureUV, i will tell you later if it work it :)) thank you very much :)))
Your answer
Follow this Question
Related Questions
Allowing User to Draw a Gameobject 0 Answers
Debug.DrawLine problem 1 Answer
How to draw a gizmo on a Canvas ? 2 Answers
Drawing a glowing line from one point to another on update 1 Answer