Forum Discussion
FisherDachs
11 years agoHonored Guest
Unity Code working in DK1 no longer works for DK2
Hi there,
So this is a really simple camera switching script I had to flip between a fixed camera and a character controller camera. No problems with the DK1, and when in Unity, no problems for the DK2. However whenever I make a build, the first switch is fine, but when I try to toggle back, it freezes. Every time.
Anyone have any thoughts on why this is happening, or if there's a good alternative code for this action? Thank you!
Javascript:
So this is a really simple camera switching script I had to flip between a fixed camera and a character controller camera. No problems with the DK1, and when in Unity, no problems for the DK2. However whenever I make a build, the first switch is fine, but when I try to toggle back, it freezes. Every time.
Anyone have any thoughts on why this is happening, or if there's a good alternative code for this action? Thank you!
Javascript:
#pragma strict
var playerCam:GameObject;
var mainCam:GameObject;
function Awake() {
playerCam.active = false;
mainCam.active = true;
}
function Update () {
if (Input.GetKeyDown(KeyCode.C))
{
playerCam.active = !playerCam.active;
mainCam.active = !mainCam.active;
}
}
1 Reply
Replies have been turned off for this discussion
- vrdavebOculus StaffThis sounds like a bug in our rendering state machine. It looks like it is hanging when there are no active cameras. Can you always make them both active before deactivating one? If that doesn't work, can you use the same OVRCameraController all the time and make the keyboard shortcut change its position, rotation, and parent instead of activating/deactivating two?
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
- 4 days ago
- 4 years agoAnonymous