Invoke is not like real time

Hi eveyone,

I use Invoke Method but it isn’t like real time.

I used this code:

void Update () {
    Invoke("Create", 5f);
}

void Create()
{
    Instantiate(cube, new Vector3(-9.84f, 6.882f, 13.994f), Quaternion.identity);
}

But delay time isn’t 5 seconds. It’s like 1 milliSeconds. Why? I need 5 seconds delay.

If you say ‘do something after 5 seconds’ but say it 60 times every second (in Update), then after 5 seconds you will do that thing 60 times every second.

You could call InvokeRepeating once

void Start() {
    InvokeRepeating("Create", 5f, 5f);
}

Yes it’s sensible but it doesn’t work :confused:

InvokeRepeating("Cube", 5f, 20f);

alt text