how to destroy a 2d object with code in 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);
// To remove a GameObject use the function 'Destroy()'
Destroy(gameObject);
Destroy(this.gameObject);