Skip to main content
Participant
November 18, 2014

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.
    This topic has been closed for replies.

    2 replies

    Inspiring
    November 18, 2014
    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
    Participant
    November 19, 2014
    Thanks, MikeF.
    In view of your post, I attached the script containing the Raycast to the CenterEyeAnchor. My model works great. Thanks, again.