how to destroy gameobjects code example
Example 1: destroy gameobject unity
Destroy(this.gameObject);
Example 2: how to destroy parent gameobject unity
Destroy(transform.parent.gameObject);
Destroy(this.gameObject);
Destroy(transform.parent.gameObject);