how to delete an object with script unity code example
Example 1: unity remove gameobject
// To remove a GameObject use the function 'Destroy()'
Destroy(gameObject);
Example 2: how to delete objects in unity
Destroy(yourobject)
// To remove a GameObject use the function 'Destroy()'
Destroy(gameObject);
Destroy(yourobject)