GameObject Cube = GameObject.Find(“Cube”);
Cube.SetActive(false);
I have this in my FixedUpdate, and the Cube gameobject is loaded but it still says object reference not set to an instance of an object.
GameObject Cube = GameObject.Find(“Cube”);
Cube.SetActive(false);
I have this in my FixedUpdate, and the Cube gameobject is loaded but it still says object reference not set to an instance of an object.
When you call SetActive(false) on an object it is totally removed from the scene. Therefore on the second time through your FixedUpdate it will be unable to find a “Cube” game object.