unity destroy gameobject delay code example
Example: unity destroy gameobject with delay
[SerializeField] GameObject MyGreatObject;
//Choose MyGreatObject in the inspector
Destroy (MyGreatObject, 5);
[SerializeField] GameObject MyGreatObject;
//Choose MyGreatObject in the inspector
Destroy (MyGreatObject, 5);