Forum Discussion

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

OVRPlayerController Rotation around HMD

Hello,

I'm having an problem with player rotation. I'm current using OVRPlayerController for player controller. The issue is that when a player turns the character, the charater rotates about the center of the character. When the player is standing on the edge of the play area, rotations are around the vertical axis in the center of the play area, not the players head location.

How can I change this to obtain rotations about the players HMD location, even when standing at the edges of the play area?

7 Replies

Replies have been turned off for this discussion
  • Ive tried setting the character controller "Center" parameters to the location of the HMD CenterCamera (X and Z only), but any non zero parameters for Center on character controller give strange rotations
  • HI,

    Thank you for the response. The effect does exist in your sample scene. I will try to explain the issue more clearly.

    When using the OVRPlayerController and OVRCameraRig, the Character Controller component is fixed to the center of the tracking Space, while the players head is able to move around the tracking space. When the player moves to the edges of the tracking area, the HMD becomes offset from the Character Controller collider. When the player tries to rotate, this has the effect of the player swinging around a point (like a maypole), rather than rotating about their center axis. For a large tracking area, the effect becomes significant.





  • HI,

    Thank you for the response. The effect does exist in your sample scene. I will try to explain the issue more clearly.

    When using the OVRPlayerController and OVRCameraRig, the Character Controller component is fixed to the center of the tracking Space, while the players head is able to move around the tracking space. When the player moves to the edges of the tracking area, the HMD becomes offset from the Character Controller collider. When the player tries to rotate, this has the effect of the player swinging around a point (like a maypole), rather than rotating about their center axis. For a large tracking area, the effect becomes significant.






  • Change line 504 of the OVRPlayerController.cs from:
    transform.RotateAround(CameraRig.centerEyeAnchor.position, Vector3.up, euler.y);
    to
    transform.RotateAround(this.transform.position, Vector3.up, euler.y);

    This solved it for me.