Skip to main content
Up and Coming
July 12, 2014

[Solution] FollowOrientation doesn't always work

I noticed today that FollowOrientation stopped working when I was using the SDK Player Controller prefab.

To isolate the problem and repro I:
- Dragged on the prefab, set the FollowOrientation to the OVRPlayerController.
- Added a character avatar under the OVRPlayerController.
- Added a script to rotate OVRPlayerController

Running the scene, when I rotate the OVRPlayerController GameObject the VR view doesn't move.

I discovered that there is a fight between both OVRPlayerController and OVRCameraController to both call SetOrientationOffset() each Update() loop, and it is a bit random who wins, depending on how Unity script execution default to.

The bug is OVRPlayerController is continually calling SetOrientationOffset() with the original transform rotation, whilst OVRCameraController is getting the correct one via FollowOrientation ref.

A quick solution, without modifying code, is to set OVRPlayerController script execution to run first (eg: -50). Then OVRCameraController sets it second and wins.

It's a small bug, but might cause frustration for new developers. Does Oculus have a bug submission page?

HTH,

Peter
    This topic has been closed for replies.

    1 reply

    Inspiring
    July 12, 2014
    Thanks for the fix. I can create a bug report for this.
    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