cancel
Showing results for 
Search instead for 
Did you mean: 

[Solution] FollowOrientation doesn't always work

peterept
Protege
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
1 REPLY 1

cybereality
Grand Champion
Thanks for the fix. I can create a bug report for this.