I'm trying to activate and deactivate two cameras.
A first person camera and a third person camera.
void ChangeCam(){
GameObject firstCam = GameObject.Find ("First Person Camera");
GameObject thirdCam = GameObject.Find ("Third Person Camera");
bool inThidPerson = thirdCam.activeInHierarchy;
if (thirdCam) {
firstCam.SetActive = true;
thirdCam.SetActive = false;
}
else {
firstCam.SetActive = false;
thirdCam.SetActive = true;
}
}
But I'm getting this error.
Why is that? inThirdPerson is a variable, of the bool type, which should be able to make if/else statements.
↧