Search Unity

How to draw straight lines using HTC VIVE

Discussion in 'AR/VR (XR) Discussion' started by vinojan1, Aug 20, 2017.

  1. vinojan1

    vinojan1

    Joined:
    Jul 27, 2017
    Posts:
    1
    Hello , I am new to C# and unity ,I am wondering how can I draw a straight lines using the HTC Vive Controller. Can I use Line Renderer and if so , how do I get a straight line. Thanks for the help :)
     
  2. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    Yes you can use Line Renderer.

    https://docs.unity3d.com/ScriptReference/LineRenderer.html

    Use set position with any two points and it will be a straight line. If you need a curved line you break it down into a number of smaller line segments.