Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
MacOSXprogramme's avatar
MacOSXprogramme
Honored Guest
11 years ago

Problem with Player

I am having a problem with my OVRPlayer.
I have a room with a number of doors. I have a script which opens the various doors. I'm using "if (Physics.Raycast (transform.position, transform.forward, out hit, distTo))" to detect my position in front of the door. If I use the mouse to rotate my character, the desired door opens as designed. But if I use the HMD head tracking to rotate to the door, 'forward' doesn't seem to work. It seems to be tied to the last angle (character rotation) as set by using the mouse.
Does this mean that my head tracking rotation is not working? Or how do I lock the direction of the player to the direction as seen by head tracking.
Thanks in advance for any help.

2 Replies

Replies have been turned off for this discussion
  • if your raycast origin is the root game object of OVR player controller then you might get this problem.
    try raycasting from the left or right camera inside the OVR camera controller, or the forward direction game object if you dont need the ability to aim the raycast up and down
  • Thanks, MikeF.
    In view of your post, I attached the script containing the Raycast to the CenterEyeAnchor. My model works great. Thanks, again.