Answer the question
In order to leave comments, you need to log in
Why doesn't the method work correctly?
void Start()
{
InvokeRepeating("Spawn", Random.Range(1f,2f), Random.Range(1f,3f));
}
void Spawn()
{
Instantiate(target);
}
Answer the question
In order to leave comments, you need to log in
When you have registered a random time, it works once and does not randomize further.
That is, at the start, for example, it issued such randoms: then they remain forever until the coroutine is turned off.
You can write a small timer in Update() and call the method you need through the usual Invoke(). If you can't, I can help. InvokeRepeating("Spawn", 1.5f, 2.5f);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question