- Home /
Question by
aidangig56 · Jan 02, 2014 at 06:57 PM ·
instantiatecommandzombie
[Duplicate]How to Repeating command in js
I am trying to instantiate a zombie object every 1 seconds. but it only does it once how can I make it repeat continuously?
CODE: #pragma strict
var z : GameObject;
yield WaitForSeconds (1); Instantiate (z);
function Start () {
}
function Update () { }
Comment
Answer by sillanstudios · Jan 02, 2014 at 07:43 PM
Hi there, What you need to do is use the "InvokeRepeating" method. it goes like this:
function Start(){
InvokeRepeating(functionName,time Before repeating starts, how often to repeat);
}
function functionName(){
//spawn zombie code here
}
I hope it helped :D
Your answer

Follow this Question
Related Questions
How to Repeating command in js 3 Answers
Instantiate and save it to a variable 1 Answer
Create objects in a selected area 2 Answers
how can I present a choice under function OnNetworkLoadedLevel 2 Answers
Problems with instantiate 0 Answers