- Home /
Enforcing event function execution order in Unity?
In the Unity Docs about Order of Execution for Event Functions, I need to know more about this : "...Naturally, this cannot be enforced when an object is instantiated during gameplay."
Edit:
See here
Do you mean about Order in which your GameObjects are initialized when you hit Play?
@ Hasiniaina Add a link to the doc, so that people can read that sentence in context.
I hope you can see why the edit is important - the sentence you quoted is referring to the previous sentence about Awake and OnEnable, rather than about execution order in general.
Answer by HappiiGamer · Oct 16, 2019 at 08:48 PM
I am pretty sure this is what you are looking for. This is what happens when you first hit play. Once the game is running and new GameObjects are instantiated, this no longer applies "naturally".
Well it's not about scripts execution order but event function execution order like Start() or Awake()
Yea, this is what you want then. All Awake() methods will be called on those objets you see in that list (in that order). Then once all Awake()s have been called, all Start() methods will be called in the same sequence.
Please see the edit. For objcect instaniciated during gameplay, can we somehow change the execution order? thanks
Your answer
