Delete

From ETC Public Wiki
Jump to: navigation, search

Removing an object for game play

// Kills the game object

Destroy (gameObject);


// Removes this script instance from the game object

Destroy (this);


// Removes the rigidbody from the game object

Destroy (rigidbody);


// Kills the game object in 5 seconds after loading the object

Destroy (gameObject, 5);