script level started

I have 2 scripts that must start both at Start (). The problem is that one of them should start off per second. How can I do?

Easy way:

 System.Threading.Thread.Sleep(1000)

in the beginning of delayed Start().

Recommended way: doing all the delayed Start stuff in a first Update() call.

Is exactly one second delay necesarry?

Oh god NO!

Right answer is Script Execution Order. Access it via project settings.
That’s if it’s the timing issue.
Otherwise, stick to the coroutines, or you’ll hang entire game.

Or even better, turn Start() into an enumerator:

private readonly WaitForSeconds _oneSecond = new WaitForSeconds(1f);

...

private IEnumerator Start(){
    yield return _oneSecond;
    // Do your stuff
    yield return null;
}
1 Like

Right. I completely forgot all starts get called in the same thread.