How do you check if a game object is "missing" from a list of game objects?

I know there could be either “Game Object (Clone)” or “None (Game Object)”. But what about “Missing (Game Object)”? How do you check to see if the game object is missing, or actually gone?

Destroying a game object that other game objects have references to can easily break or make the game.

By using an intelligent pool manager, but to just check if the GO is gone you just need to do a null check.

Thanks, null checking is all I needed.

I do have an intelligent pool manager, but there are still some issues with list desyncing. And sometimes, the editor would crash if I use SyncList…

A good tip is to check against GameObject.InstanceID this numbers are alway unique, i have it integrated in to my pooling logic, it never fails… Happy that you got it sorted.

GameObject.InstanceID? I thought I need to bring up NetworkIdentity and check from there…

No your maybe mixing networkView.viewID with GetInstanceID. Every object is a instance and it has a unique number.

you get it by simple typeing YourGameObject.GetInstanceID.ToString()

There is a NetworkInstanceID in the Networking API. I thought I had to use that. NetworkView.viewID is deprecated though.

yeah it is, but not sure what version you where on… just use GetInstanceID() and you get it…no Unet needed.

5.2.1f1.

There are times where the Console would output messages saying instance IDs are missing. Oh well.

maybe your code is not pointing to the correct GameObject? Maybe that explains the null exception? Hard for me to say without seeing some code.

Wrong thread?

Once I find the actual cause, I’ll post a new thread asking about it. Thanks for offering help.

No problem, sorry about the miss post…its deleted.