The name 'GameObject' does not exist in the current context

Hi,
I’m kinda new to Unity and I have a basic problem, I havent found a solution to yet. Here’s the code:

using UnityEngine;
using System.Collections;

public class ToggleMenuButton : MonoBehaviour {
	public GameObject cameraUI;
	public GameObject menuUI;
	 	
	       	public void menuClicked () {
		cameraUI.setActive (false);
		menuUI.setActive (true);
          }
    }

The name ‘GameObject’ does not exist in the current context (in MonoDevelop)

error CS1061: Type UnityEngine.GameObject' does not contain a definition for setActive’ and no extension method setActive' of type UnityEngine.GameObject’ could be found (are you missing a using directive or an assembly reference?)

I’m using the latest version of Unity. Thanks.

The method you’re trying to call starts with a capital “S”, modify to use the correct casing for the method name like so:

using UnityEngine;
using System.Collections;

public class ToggleMenuButton : MonoBehaviour {
	public GameObject cameraUI;
	public GameObject menuUI;

	public void menuClicked () {
		cameraUI.SetActive (false);
		menuUI.SetActive (true);
	}
}

GameObject.SetActive documentation.

The “SetActive(bool)” function needs to start with a capital “S”.

cameraUI.SetActive(false);
menuUI.SetActive(true);