Quantcast
Channel: Latest Questions by f_rodrigues
Viewing all articles
Browse latest Browse all 18

The left-hand side of an assignment must be a variable, a property or an indexer

$
0
0
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.

Viewing all articles
Browse latest Browse all 18

Trending Articles