Oculus: Is player looking at Object A ?

Hello everybody,

so far i have used this code to check if player looks at objects:

var ySize = Screen.height*percentageOfScreenHeight;
    centerRect = Rect(Screen.width/2 - ySize/2, Screen.height/2 - ySize/2, ySize, ySize);


if (centerRect.Contains(Camera.main.WorldToScreenPoint(transform.position)) && renderer.enabled ) {
    TimerForLooking += Time.deltaTime;   
    }

and somehow the same code does not work, if i use the character from the rift sdk.

Is there any chance how to see if someone looks at an object, but with with the rift?

Getting really desperate …

thank you !

If you are using the oculus camera, you need to divide the ScreenWidth by 2 to get the width of each camera’s view, since they are side by side.