gameObject.Find("cam1").GetComponent("Camera").active = true/false
but it's not working, an error comes up that says "NullReferenceExeption"
so is there any other way?
asked Aug 16 '10 at 08:27 PM
i would use something like this :
answered Aug 16 '10 at 09:11 PM
The Null reference exception is coming up because Unity cannot find a GameObject with name - "cam1". Instead you can try using an If condition to check if the GameObject exists and then change the settings.
I think the code should be something like this -
answered Aug 16 '10 at 10:24 PM