Forum Discussion

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

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

5 Replies

Replies have been turned off for this discussion
  • Gerald's avatar
    Gerald
    Expert Protege
    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.
  • 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
  • Gerald's avatar
    Gerald
    Expert Protege
    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.
  • 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.
  • 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