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.