- Home /
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 !
Answer by Jeff-Kesselman · May 09, 2014 at 12:01 AM
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.
Well, close. The center is going to be at Screen.Width/4, (and at 3*Screen.Width/4)
Your answer
Follow this Question
Related Questions
Disabling VR Camera rotation creates ''cinema'' effect in VR device 1 Answer
How to display a camera on the screen while displaying the Oculus Rift in direct mode ? 1 Answer
How can integrate Oculus camera script in unity project? 0 Answers
Can one camera be the background layer for 2 others? 0 Answers
Oculus rift Camera controller? 0 Answers