how to deactivate gameobject in script unity code example
Example 1: how to deactivate objects through scripts in unity
public GameObject Name = GameObject.Find("Name");
Name.enabled = true;
Example 2: deactivate a gameobject unity
public void SetActive(bool value);