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 ....
1) When you instantiate the object, cache a reference to it. Use that reference instead of Find. 2) 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. 3) Instead of making the object inactive, disable all its components but leave the object active. Find will be able to find it.