Search Unity

Align a line renderer on vertical/horizontal axis relative to a mesh

Discussion in 'Scripting' started by shura0123, May 11, 2018.

  1. shura0123

    shura0123

    Joined:
    Jun 26, 2017
    Posts:
    8
    What I am trying to figure out is how can I do an alighnment on a vertical/horizontal axis relative to a mesh.

    I use a raycast to position my points once 2 points have been set the line renderer renders between the 2 points with SetPosition and Quaternion.LookAt(hit.normal) to set the normal and the line is set to world space position. What I am trying to achieve is once the line renderer is set, with a button i want that line renderer to be set or rotated on a straight angle either vertically or horizontally relative to the mesh. (I already know how to setup the button. Anyone with helpfull advice would be great. thank you


    I have drawn a quick mockup
     

    Attached Files: