Question by
richardzzzarnold · Nov 18, 2016 at 03:31 PM ·
instantiationyield waitforseconds
Are there time limitations on yield WaitForSeconds?
I have a triggered instantiation with yield WaitForSeconds in front of it. It works fine with a wait of 15 seconds. It works fine with a wait of 25 seconds. But for some reason, 30+ seconds, it won't call the instantiation.
its on a non-deleted independent object..code as follows...
function DelayspawnerMagicPill(){
yield WaitForSeconds(35);
var randomPick4 : int = Mathf.Abs(Random.Range(0,spawnlength));
var DsMP : GameObject = Instantiate(MagicPill, spawn[randomPick4].position,spawn[randomPick4].rotation);
var spawnJS4 = new Array() ;
spawnJS4=spawnCopy;
spawnJS4.RemoveAt(randomPick4);
spawnCopy =spawnJS4;
spawn=spawnJS4;
}
Comment
I would definitely not assume, that a function using a float and not nearly reach to it's limits would fail at an arbitrary number.
try looking for the problem somewhere else. do you have some StopAllCoroutines going on, or the function is not called? putting Debug.Logs might help you
Your answer
![](https://koobas.hobune.stream/wayback/20220612100926im_/https://answers.unity.com/themes/thub/images/avi.jpg)