Cannot enable child gameobject - Help!

I am trying to enable the Main Camera of the Player through script but it just gives me an error.

Here is the code: myPlayer.transform.FindChild('Main Camera').gameObject.SetActive = true;

I am getting this error:

Assets/Scripts/NetworkManager.js(41,64): BCE0049: Expression ‘myPlayer.transform.FindChild(‘Main Camera’).gameObject.SetActive’ cannot be assigned to.

PLEASE HELP :smile:

http://docs.unity3d.com/ScriptReference/30____search___.html?q=setactive
xxxx.SetActive(true);

2 Likes

That was stupid of me… Thanks lol

The one you may have been thinking of is when you have a component on a gameobject and you use enable = true.