unity3d - Unity: Spawn element on accurate position over time -
i wish spawn enemies moving on same speed @ specific position repeating every x milliseconds.
the problem update() function in unity occurs in non deterministic time, cannot spawn in accurate position, , delays , inaccurate positions of elements. how can solve this?
coroutines useful trigger methods periodically.
you can check this unity forum post see how works.
ienumerator spawndelay() { spawn(); //your spawn method yield return new waitforseconds(5); startcoroutine("spawndelay"); //restarting coroutine after 5 sec delay }
Comments
Post a Comment