Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

GearVRController - How to display a RayCast / Pointer from the remote?

Discussion in 'AR/VR (XR) Discussion' started by davidbeloosesky, Jul 5, 2017.

  1. davidbeloosesky

    davidbeloosesky

    Joined:
    Jan 3, 2017
    Posts:
    4
    Hi,

    I follow the Oculus sample about adding a GearVR controller to the scene.
    I added one, and it's follow the user hand.

    How can I add a ray from the controller like the controller in the Oculus menus?
    http://imgur.com/gtXlRsG
     
  2. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    There are a couple of ways to do this. The one I did in my asset in my signature is to use a linerenderer to project the ray from the controller along it's forward transform.
     
  3. davidbeloosesky

    davidbeloosesky

    Joined:
    Jan 3, 2017
    Posts:
    4
    I will appreciate you a lot more if you could please explain what you did there, and not just link to a 35$ asset.
     
  4. dmennenoh

    dmennenoh

    Joined:
    Jul 1, 2015
    Posts:
    379
    FWIW, I just used a long thing cylinder with emission on...
     
  5. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    I did, like I said I used a linerenderer projected from the controller position along it's forward transform. There are many ways to do this though you could use geometry like @dmennenoh as well.
     
  6. davidbeloosesky

    davidbeloosesky

    Joined:
    Jan 3, 2017
    Posts:
    4
    Thanks! How did you attached the cylinder to the gearvr controller?