Advertisement
kasru

Spawn Minions

Jan 23rd, 2013
4,126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //****** Donations are greatly appreciated.  ******
  2. //****** You can donate directly to Jesse through paypal at  https://www.paypal.me/JEtzler   ******
  3.  
  4. var node1 : Transform;
  5. var minionPrefab : GameObject;
  6. var spawning : boolean = true;
  7.      
  8. function Start () {
  9.      spawnMinion();
  10. }
  11.      
  12. function Update () {
  13.      
  14. }
  15.      
  16. function spawnMinion () {
  17.      
  18.     while(spawning) {
  19.             yield WaitForSeconds(0.2);
  20.             Instantiate(minionPrefab,node1.transform.position,node1.transform.rotation);
  21.             yield WaitForSeconds(5);
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement