- Home /
How you find an Object
How you find an object after you delete and instantiate it again ?
This is the error Im getting
MissingReferenceException: The object of type 'Transform' has been destroyed but you are still trying to access it. Your script should either check if it is null or you should not destroy the object.
Otherwise to find object you can refer :
http://docs.unity3d.com/ScriptReference/GameObject.Find.html
I saw the code you posted earlier uanmanarmy, but you didn't cut it down to the important bits. Anyway, from what I've seen you had the right idea: $$anonymous$$eep a reference to the instantiated game object(s)..
Im doing like this
_blue = GameObject.Find ("Item_bbg(Clone)");
and Debuging
Debug.Log (blue);
But after I delete it and Instantiate it again it tells me that blue has a null value. (
Answer by pacific00 · Aug 11, 2014 at 12:22 PM
a better method could be to instantiate just once at the beginning and turning it off/on when required rather than deleting it.. both delete and instantiate are costly..
Yes you are right, but rather than deleting and instantiating I would like to autoposition them, That Will be better
maybe something like this? but I dont know how to make them autoposition.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Problem with Unity 0 Answers
A node in a childnode? 1 Answer
Slicing Objects 1 Answer
Creating Object Fog? 1 Answer