Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

How does an object(nearest to player) detect that the headset viewing line is within its boundaries

VRfriend2016XVRfriend2016X Posts: 144
Hiro Protagonist
I know you're all familiar with how in Oculus home or some other calibration thing or in Farlands....a dot is placed  on the objects that are in alignement with the center view of the headset and you can interact with those objects or creatures.

Well i want to know how to do a similar thing for my game. How does an object detect that the headset viewing line is within it's boundaries. NOTE that i would surround small things with invisible gameobjects as detectors.

But anyway, if my center view HITS that detector then that means i can have some interaction with that object. But i only want it on the nearest to me or top most thing. I don't want several items to be affected.   So for example look at a switch on the wall and  it detects if you look at it( at the gameobject cube thta i'm going to surround it with) and once that happens i can press a Button on the xbox controller and can switch light on or off. Same with a lamp, same with a TV etc.

So what's the method/ that tells and object "yes I'm in alignment with you i'm looking at you"

In genal terms i would do this for a switch

if(  lightSwitchdetector is in alignment with view of headset center line   AND player is close to lightdetectorswitch)
      then if user presses xbox button toggle light on or OFF.


Best Answer

Answers

  • VRfriend2016XVRfriend2016X Posts: 144
    Hiro Protagonist
    Well i didn't really want cursors or UI. I want to interact with objects without having any cursors. Even people, lamps , lightswitches, computers, . And this one is an interesteing one i have planned. look at entire face of a person    VS looking at hand. Those two, after pressing an xbox button would give me some random results like the guy would get angy and say "what you looking at me for?"   or if i look at his hand, and press a key i would slap it(animation)
Sign In or Register to comment.