unity3d - How I can instantiate various prefabs in a given time for each? -
i developing video game guitar hero type. finished everything. need configure notes.
i have script instantiates me prefab (a note) , generates time time. there not 1 note. there 23 , wonder if possible instantiate each different timers , within same script.
for example, first note should generated 1 second , second 3 seconds.
this script have:
#pragma strict var yellownote: gameobject; var time = 1; function start () { while (true) { yield waitforseconds (time); instantiate (yellownote, transform.position, quaternion.identity); } }
you define array of times you'd between each instantiation. then, iterate through array loop , waitforseconds
inside loop.
Comments
Post a Comment