I just put my function:
void Start()
{
StartCoroutine(FunctionName());
}
IENumerator FunctionName()
{
while(true)
{
yield return new WaitforSeconds(time you want);
instantiate enemy
yield return new WaitforSeconds(time you want);
}
}
I found this to work better then invoke repeating
↧