Skip to main content
Up and Coming
September 18, 2014

OVRPlayer does'nt properly inherit orientation of parent

To give some background, my OVRPlayer object is placed on the bridge of a ship. It is a child of this ship object. When the ship moves, the position of the OVRPlayer is fine. When the ship itself rotates though, the player orientation goes out of wack. For example, my OVRPlayer will pull to the left of right when I begin moving. The OVR Cameras attached to the player follow the orientation absolutely fine. I really do not know how to fix this.

Thanks
    This topic has been closed for replies.

    5 replies

    Up and Coming
    September 18, 2014
    you likely have some issue with parent/child orientation translation while also having the "follow orientation" doing something similar.

    please be more specific what happens. maybe add a screenshot of how your gameobjects are parented and what the settings on the controller are.
    check out my Mobile VR Jam 2015 title Guns N' Dragons
    Up and Coming
    September 18, 2014
    Ok, the heirarchy is as follows-

    Ship-Wrapper --- Transforms are applied to this game object to move the ship around
    =>Ship --This is the Mesh of Ship. There is a looping animation on this mesh that makes it 'rock on the water'
    ==>OVR Player Controller

    I am using SDK version 0.4.2, although I've had this problem since I began making this with 0.2. On the OVR player the only parameters I have changed are the height and radius of the character controller.

    On the OVRPlayerController, I have set 'follow orientation' to the transform of the main parent object. Even if this is not set, I still get the same problem. Finally, '~Tracker Rotates Y is enabled'. Everything else is set to default.

    So the problem is that when I am walking around freely on the ship while it is moving, when the ship rotates on the y-axis, the player movement becomes 'wonky'. For example, if I attempted to walk from one end of the bridge to the other in a straight line, my player will constantly pull to to the left or right, regardless of whether the camera orientation is correct or not.

    Some of the data I am working with is sensitive so sorry about the lack of screenshots
    Up and Coming
    September 18, 2014
    I have noticed weird behavior with nested gameobjects and rotations - do you use the OVRPlayerController?
    If yes, have you tried a normal player controller and just adding the OVRCameraController to it instead?
    Iirc the OVRPlayerController uses your looking direction as forward (there is the ForwardDirection gameobject you might want to have a look at when things get wonky) - using a normal Playercontroller will disable that and at the very least it could help you narrow the error source down.
    check out my Mobile VR Jam 2015 title Guns N' Dragons
    Inspiring
    September 18, 2014
    OVRPlayerController is pretty bare-bones, and really isn't designed to be used in a real game (aside from simple walk-throughs). You may want to try using the default Unity first-person controller and putting the OVRCameraController inside. You can use the FollowOrientation parameter to sync them together. I know this helped with moving platforms and elevators. I did not try to rotating objects but it guess it could work.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    Up and Coming
    September 19, 2014
    Sweet!!

    That seems to have done the trick. For those who are wondering, I made sure to uncheck the 'Moving Platform' and 'Sliding Options' in the Character Motor script. The transforms are working as I expect them to now.

    Massive thanks to both of you