Return true if this object is destroyed. This will also return true if the object is marked to be destroyed soon.
Return true if this object is destroyed. This will also return true if the object is marked to be destroyed soon.
Use the IsDestroyed
property to check if a GameObject
has been destroyed or is scheduled for destruction. This can be useful to prevent operations on objects that are no longer valid.
// Example of using IsDestroyed property GameObject myObject = new GameObject(); // Perform some operations // Check if the object is destroyed if (myObject.IsDestroyed) { // Handle the destroyed object case // For example, log a message or skip further processing Log.Warning("The object is destroyed or will be destroyed soon."); } else { // Continue with operations on the object }