Skip to main content
New Participant
September 26, 2017

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

    7 replies

    New Participant
    September 26, 2017
    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
    New Participant
    September 27, 2017
    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.



    New Participant
    February 11, 2020
    How is this fixed?
    New Participant
    February 12, 2020


    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.






    New Participant
    February 12, 2020
    Did you ever get this fixed?
    Participant
    February 28, 2023

    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.

    New Participant
    July 12, 2023

    Anyone solve this?