I am trying to scrape together something for VR in which the locomotion is based the player holding the direction where he wants to go to (basically planning what he is going to do). While the player is holding down the button a ray (aligned to the direction of intended travel) is being drawn. When the player lets go the character moves until he reaches the end of the ray.

I tried looking up something but couldn't find anything regarding something like this.

  • \$\begingroup\$ Presumably you tried implementing this with a raycast and a LineRenderer? What did you try so far and where specifically did you run into trouble? \$\endgroup\$
    – DMGregory
    Jul 25, 2020 at 3:23

1 Answer 1


The component you are looking for is the LineRenderer. While you can use it to visualize paths in 3d space with as many points as you want, it is just as well possible to use it to draw a simple two-point line. You can use materials to customize its appearance.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .