Answers for "unity all game object disappear"

C#
1

make an object disappear from a c# script unity

public GameObject ObjectToDisappear;

void Start()
{
	ObjectToDisappear.GetComponent<Renderer>().enabled = false;
}
Posted by: Guest on May-08-2020
1

how to make an object appear and disappear in unity

void Update() {
   if (Input.GetMouseButtonDown(0)) {
     gameObject.active = true;
   }
   if (Input.GetMouseButtonDown(1)) {
     gameObject.active = false;
   }
 }
Posted by: Guest on July-10-2020

C# Answers by Framework

Browse Popular Code Answers by Language