Quantcast
Channel: Answers for "destroy object after a delay?"
Browsing all 12 articles
Browse latest View live

Answer by fafase

All is there http://unity3d.com/support/documentation/ScriptReference/index.Coroutines_26_Yield.html Hope that helps

View Article



Answer by BiG

It's easy: Define a function like this: var delay = 2.0; //This implies a delay of 2 seconds. function WaitAndDestroy(){ yield WaitForSeconds(delay); Destroy (gameObject); } Call this function when you...

View Article

Answer by MP2fps

var destroyTime = 5; function Update () { Destroy(gameObject, destroyTime); }

View Article

Answer by Wiebren de Haan

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...

View Article

Answer by wrobel221

You can just set time delay in Destroy method Object.Destroy(gameObject, 2.0f); Here's the [method description][1] static void Destroy(Object obj, float t = 0.0F); [1]:...

View Article


Answer by edisonk

destroy(gameObject,2f);

View Article

Answer by fafase

All is there http://unity3d.com/support/documentation/ScriptReference/index.Coroutines_26_Yield.html Hope that helps

View Article

Answer by BiG

It's easy: Define a function like this: var delay = 2.0; //This implies a delay of 2 seconds. function WaitAndDestroy(){ yield WaitForSeconds(delay); Destroy (gameObject); } Call this function when you...

View Article


Answer by MP2fps

var destroyTime = 5; function Update () { Destroy(gameObject, destroyTime); }

View Article


Answer by Wiebren-de-Haan

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...

View Article

Answer by wrobel221

You can just set time delay in Destroy method Object.Destroy(gameObject, 2.0f); Here's the [method description][1] static void Destroy(Object obj, float t = 0.0F); [1]:...

View Article

Answer by edisonk

destroy(gameObject,2f);

View Article
Browsing all 12 articles
Browse latest View live




Latest Images