GameObject.SetActive
SetActive(value: bool): void;
void SetActive(bool value);
def SetActive(value as bool) as void
Description

Activates/Deactivates the GameObject.

Note that a GameObject may be inactive because a parent is not active. In that case, calling SetActive() will not activate it, but only set the local state of the GameObject, which can be checked using GameObject.activeSelf. This state will then be used once all parents are active.

See Also: GameObject.activeSelf, GameObject.activeInHierarchy.
	// Deactivates the game object.
	gameObject.SetActive (false);
using UnityEngine;
using System.Collections;

public class Example : MonoBehaviour {
    void Example() {
        gameObject.SetActive(false);
    }
}
import UnityEngine
import System.Collections

public class Example(MonoBehaviour):

	def Example() as void:
		gameObject.SetActive(false)