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;
}
}
