How do I un nulify a nullified object?

I nulled an object and I would like to un null it.

Like when I receive a message the object gets nulled.

How do I un nullify it?

Thanks for any answers!

How do you "nullify" an object?

gameObject = null. But how do I toggle the null attribute? is there one? like gameObject.null = false or something? I can't find any documentation on this. But if you can null a reference type you must also be able to un null it. The problem i'm having is probably in this script. <pre> function ItemChosen (number : int) { if (number == 1) { chosenItem1 = null; } if (number == 2) { chosenItem2 = null; } if (number == 3) { chosenItem3 = null; } } </pre>

1 Answer

1

There is no such thing as a null attribute. If you set a variable to “null” you basically remove the reference to it and if that was the only one in your code the garbage collector will destroy the object. In you example if you set the references for the items to null you lose that reference. If you could elaborate why you want to “null” this object, or rather what you think happens when you do it I might be able to help you with that.

Never mind, all I had to do was rearrange my code a little bit. ... Toggle the nullify attribute... xD

Oh, and thanks a bunch! really saved me and everyone else a lot of time ++!