when i use GameObject G=GameObject.Find(“The_Room”);
it doesnt get it …cause its inactive .
how can i get it ?
it give me an error :
NullReferenceException: Object reference not set to an instance of an object …
- When you instantiate the object, cache a reference to it. Use that reference instead of Find.
- If the object is a part of the scene itself, create a reference to it on a script on another object. Use that reference instead of Find.
- Instead of making the object inactive, disable all its components but leave the object active. Find will be able to find it.
Thanks a lot for your help.