unity destroy after time code example
Example 1: how to destroy a gameobject after a sertain amount of seconds
Destroy(objReference, timerInSeconds);
Example 2: unity destroy gameobject with delay
[SerializeField] GameObject MyGreatObject;
//Choose MyGreatObject in the inspector
Destroy (MyGreatObject, 5);