var Seconds = 10;
function Update(){
Destroy();
}
function Destroy(){
yield WaitForSeconds(Seconds);
Destroy(gameObject);
}
Add this to a javascript, set the time in Seconds (Use the var). And the gameobject will be destroyed after in this script 10 seconds
↧