Forum Discussion
peterept
11 years agoProtege
[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
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
Replies have been turned off for this discussion
- cyberealityGrand ChampionThanks for the fix. I can create a bug report for this.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 1 year ago