Line renderer rotation and alignment

Hey, I try to draw a line using line renderer, I have problem with its rotation that always face the camera. Let’s say i’d like to draw from Vector3(0, 0, 0) to Vector3(0, 0, 5)

I read the documentation you can rotate camera to local transform components by set alignment to local but when I did that the line is gone instead. I’m using Unity 5.6.0f3. anyone can help?

UPDATE
I tried to rotate root transform and the line is there to Vector3(-16, 0, -10). But I cannot find it when the rotation is Vector3(0, 0, 0)

Try checking use world space.

1 Answer

1

Change the allignment to local so the line wont face to the camera, then if you rotate the root GameObject your line will rotate with it,
Please Note That Line renderer makes a polygon, and polygons have a nice attribute that only one of their side gets rendered, to outplay this tick in loop, or make 2 line renderers, when loop aint gives a good solution for example in lines with more than 2 verticies