unity delete self code example
Example 1: destroy gameobject unity
Destroy(this.gameObject);
Example 2: unity destroy self
Destroy(gameObject);
Example 3: how to destroy in unity
// To remove a GameObject use the function 'Destroy()'
Destroy(gameObject);