Forum Discussion
Jerware
12 years agoExplorer
How to force a new camera rotation?
I'm toying around with a game that doesn't use a character controller and just lets the player ride something and look wherever he wants. At certain points though, I need to reposition the player (i.e. move the camera to another position and change its rotation). I can change the position easy enough, but how can I change the rotation of the camera while the game is running? It only seems to inherit the rotation of the parent object on Start. I've tried turning on "Follow Orientation" mid-game, just for the change, but that didn't seem to work. Any clues?
4 Replies
Replies have been turned off for this discussion
- SiggiGProtegeI'm using the follow orientation feature in my game and respawning the player to a different place in a different orientation just fine. Maybe destroying the player and spawning a new one would solve your issue?
- JerwareExplorerOk, thanks. I guess I'll try leaving Follow Orientation on the whole time and have it orient to an object that I just use to change rotation now and then.
- petergiokarisProtegeHey Jerware,
So yes, it's best to set FollowOrientation and use that to set the orientation that you want stereo cameras to be relative to. You can also change this transform on the fly with another transform, and that will be the new target orientation that the camera will offset from.
If this is set to null, the orientation of the stereo cameras will be set to what OVRCameraController is set at time of creation. This is fine for when a scene is created, but using FollowOrientation is much more useful for changing the cameras on the fly, be it for a static transition, or for a dynamically moving object that you want to anchor the cameras to.
In a future update I plan to allow you set a transform for targeting the Y rotation with 'Tracker Rotates Y'. If this is on AND a transform is set, it will target that transform, otherwise it will target the OVRCameraController transform. Adding X and Z may be something that may become useful; I am hoping to hear from everyone to see what else they would like to see added to the camera system.
Best,
Peter - JerwareExplorerGot it, thanks guys. I agree that adding X and Z would be helpful, Peter, at least for experimentation's sake. We're all learning what works and what doesn't. A friend of mine had the idea to make the player do flips in the air when jumping, which I suggested would induce vomiting... but it would be fun to try nonetheless. :)
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
- 9 years agoAnonymous
- 8 months ago
- 8 months ago