Forum Discussion
ChiaraStellata
12 years agoExplorer
Workaround for non-functioning Editor Play
I experienced the same issues described in this thread where I wasn't able to use Editor Play mode because of random failing behaviour:
viewtopic.php?f=37&t=14330#p190480
So I implemented a simple workaround that appears to work in Tuscany and should also work in other Unity applications. It works by switching the OVRCameraController to play the game in regular monitor-mode when running in the editor. (You will need some way to turn without using the headset as the headset will be nonfunctional). Just add this code fragment to the beginning of Start() in OVRCameraController.cs:
This disables two scripts: the OVRCameraController script itself, and the OVRCamera script on the right camera, which then takes over the Game window as a normal undistorted camera. In a build of the game running outside the editor, the above code does nothing, as desired. Here's a screenshot of it in action:
http://i.imgur.com/jDwIpbr.png
viewtopic.php?f=37&t=14330#p190480
So I implemented a simple workaround that appears to work in Tuscany and should also work in other Unity applications. It works by switching the OVRCameraController to play the game in regular monitor-mode when running in the editor. (You will need some way to turn without using the headset as the headset will be nonfunctional). Just add this code fragment to the beginning of Start() in OVRCameraController.cs:
if (Application.isEditor) {
gameObject.GetComponent<OVRCameraController>().enabled = false;
CameraRight.GetComponent<OVRCamera>().enabled = false;
return;
}
This disables two scripts: the OVRCameraController script itself, and the OVRCamera script on the right camera, which then takes over the Game window as a normal undistorted camera. In a build of the game running outside the editor, the above code does nothing, as desired. Here's a screenshot of it in action:
http://i.imgur.com/jDwIpbr.png
1 Reply
Replies have been turned off for this discussion
- GeraldExpert Protegewow - that is fantastic! still need to test it myself, but no longer having to switch cameras and getting the result of what it will look like in the Rift is worth gold!! Thank you so much for sharing. :)
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 months ago
- 6 months ago
- 8 months ago
- 9 months ago
- 29 days ago