- Home /
Question by
OmegaVemon · Nov 24, 2010 at 12:18 AM ·
gameobjectdestroynull
Array containing destroyed object = Null?
In some script...
var myArray = new Array();
myArray[0] = SomeGameObject;
Inside SomeGameObject...
Destroy(gameObject);
What happens when I try to access myArray[0]
? Do I get Null? If I tried to do anything with Null, dunno, access Transform, do I get an error?
Comment
Best Answer
Answer by Loius · Nov 24, 2010 at 01:42 AM
myArray[0] is null, yes.
And trying to access any component of null will get you a null reference exception.
Your answer
Follow this Question
Related Questions
using Contains(gameObject) to find and destroy a gameObject from a list 2 Answers
Why am i getting a null reference? 1 Answer
Can't destroy objects 1 Answer
missing gameobject ≠ Null? 1 Answer
Destroyed gameobject become Null ? 1 Answer