Search Unity

Question 3D line automatically rotates to camera

Discussion in 'Editor & General Support' started by svenvanh, Oct 29, 2020.

  1. svenvanh

    svenvanh

    Joined:
    Nov 29, 2019
    Posts:
    51
    So I'm trying to create a line but it keeps rotating to the camera (see photo). Is it possible to make a line that stays horizontal?
    I'm using unity 2020.1.2f1 3D

    thanks!
     

    Attached Files:

  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,689
    If that is a LineRenderer you're using, that's what they do by default. Check the "Alignment" field... I think you can give it other ways to align itself, such as to a custom Transform.

    You can also bake the mesh (freeze it basically) and put it on your own MeshRenderer to keep it from billboarding.
     
    svenvanh likes this.
  3. svenvanh

    svenvanh

    Joined:
    Nov 29, 2019
    Posts:
    51
    Hi Kurt-Dekker,
    changing the alignment to Transform Z indeed worked. I only had to change the rotation of the transform and now it works!

    Thanks!
     
    Kurt-Dekker likes this.