- Home /
line renderer question
i create one empty gameobject & attach line rendered that object have only line renderer no other rendered attach to this game object so, my question is when i press a key or when collide some object then i want just uncheck this line renderer so, its like invisible object
Sorry, you're going to have to rephrase your question... I don't think anyone knows what you're talking about.
ya i got it how to do that check this
somegameobject.GetComponent(LineRenderer).enable= true;
Answer by poncho · Mar 25, 2011 at 02:32 PM
the easy way to do this is a line renderer with 2 vertex
MyLineRenderer.SetVertexCount(2);
MyLineRenderer.SetPosition(0,myFirstObjectPosition);
MyLineRenderer.SetPosition(1,mySecondObjectPosition);
this will make a line between the 2 objects by this you need to attach the LineRenderer to the script and the first and second object positions you can get them from GameObject.Find("NameOfYourObjectToFind").Transform.Position
long time since it was asked, hope helps others
Your answer
Follow this Question
Related Questions
Line Renderer Round 1 Answer
JS Script only work in Editor 0 Answers
Line Renderer and Collider Question 0 Answers
MeshRenderer Scirpt help 1 Answer
LineRenderer - Not Showing within Game 2 Answers