delete gameobject unity code example
Example 1: unity remove gameobject
// To remove a GameObject use the function 'Destroy()'
Destroy(gameObject);
Example 2: destroy gameobject unity
Destroy(this.gameObject);
Example 3: unity remove component in script
Destroy (gameObject);
Example 4: how to destroy a gameobject in c#
Destroy(gameObject); // destroys the game object attached to the script
Example 5: how to delete objects in unity
Destroy(yourobject)