- Home /
Question by
Mayers · Nov 20, 2013 at 04:41 AM ·
linerenderer
make line render follow trajectory
hi! im trying to make a line renderer follow the trayectory of an object for a grappling hook script. the idea is to get a fixed starting point and have the line follow the curve the hook moves on and adding segments as the hook travels further. this is what i got so far grap being the gun and hook the flying rigidbody object ,
int i =1;
int vert =2;
hookRenderer.setposition(0,Grap.transform.position);
while (i<vert){
vert=vert+1;
hookRenderer.SetVertexCount(vert);
hookRenderer.SetPosition(i-1, lastposition);
hookRenderer.SetPosition(i, hookinstance.transform.position);
lastposition=hookinstance.transform.position;
i=i+1;
}
Comment
Your answer
Follow this Question
Related Questions
Different materials in line renderer and antialiasing 0 Answers
LineRenderer draw every second line 2 Answers
Linerenderer circle not drawing as expected 3 Answers
Draw line in runtime 1 Answer
LineRenderer is not visible 2 Answers