Lifecycle Question: Calls to Update() before Start() completed

EDIT:

Please ignore this question, I made a mistake with my logic. The following question is obsolete.

ORIGINAL POST:

Hi,

I’m having a class Init : MonoBehaviour that contains a bunch of events, which are fired during Init.Start() Others subscribe to those events as to organize the Startup of a scene.

Now I’m logging Init.Update() during startup (determined by a bool initComplete which changes, once Init.Start() completes) and it turns out, that multiple calls to Init.Update() occur, before Init.Start() has completed.

I expected that this would be impossible, is there somebody who can explain this behavior to me?

Btw, none of my code is async and there is currently only one Scene, so all this happens when starting the game. And obviously I don’t reference static methods in the text above, but the actual event-functions of any monobehaviour instance.

It is still an EXCELLENT question that comes up a lot.

Here is some timing diagram help:

Good discussion on Update() vs FixedUpdate() timing:

https://jacksondunstan.com/articles/4824

Hi Kurt,

Thank you for those links, and sorry for my late reply!

I’m quite familiar with the lifecycle diagram, which is why I got so confused in the first place, when all values seemed to “jump” beyond the possible range of a single Update() call on startup. It turned out, that during the first Update(), Time.deltaTime includes the duration of the game’s initialization time (ofc it does, facepalm!) and I didn’t factor that little fact in… then I placed my Debug.Log() in the wrong scope and got a false positive confirmation that Update() got called multiple times ^^

Stupid little mistakes, right?

I don’t consider it stupid when the documentation makes no mention of it.

Ryiah, seems like you’re right in that there’s no info about that in the docs.

So maybe this thread will be helpful to someone after all.