0
0
Unityframework~10 mins

Awake vs Start execution order in Unity - Visual Side-by-Side Comparison

Choose your learning style9 modes available
Concept Flow - Awake vs Start execution order
GameObject Created
Awake Called on All Scripts
Start Called on Enabled Scripts
Game Starts Running
Unity calls Awake first on all scripts when the object is created, then calls Start on enabled scripts before the game begins running.
Execution Sample
Unity
void Awake() {
    Debug.Log("Awake called");
}

void Start() {
    Debug.Log("Start called");
}
This code logs messages showing when Awake and Start methods are called during Unity's execution order.
Execution Table
StepMethod CalledScript StateActionOutput
1AwakeAll scripts initializedInitialize variables, setup references"Awake called" logged
2AwakeNext script initializedInitialize variables, setup references"Awake called" logged
3StartScripts enabledBegin gameplay logic"Start called" logged
4StartNext script enabledBegin gameplay logic"Start called" logged
5Game RunningAll scripts readyGameplay proceedsNo further Awake or Start calls
💡 All Awake methods run first on all scripts, then all Start methods run on enabled scripts before gameplay continues.
Variable Tracker
VariableBefore AwakeAfter AwakeAfter StartFinal
isInitializedfalsetruetruetrue
isReadyfalsefalsetruetrue
Key Moments - 2 Insights
Why does Awake run before Start on all scripts instead of running Awake and Start on one script before moving to the next?
Unity calls Awake on all scripts first to ensure all objects are initialized before any Start method runs, as shown in execution_table steps 1-2 (Awake) then 3-4 (Start).
What happens if a script is disabled when Awake runs?
Awake still runs on disabled scripts to initialize them, but Start only runs on enabled scripts, as seen in execution_table where Start runs only on enabled scripts.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, at which step does the first Start method run?
AStep 3
BStep 2
CStep 1
DStep 5
💡 Hint
Check the 'Method Called' column for 'Start' and see which step it first appears.
According to variable_tracker, when does 'isReady' become true?
AAfter Awake
BBefore Awake
CAfter Start
DNever
💡 Hint
Look at the 'isReady' row and see when its value changes to true.
If a script is disabled, which method will still run according to the execution flow?
ANeither Awake nor Start
BAwake only
CStart only
DBoth Awake and Start
💡 Hint
Refer to the key_moments section explaining Awake runs on disabled scripts but Start does not.
Concept Snapshot
Awake runs first on all scripts when objects are created.
Start runs after Awake only on enabled scripts.
Awake is for initialization; Start is for gameplay setup.
Awake always runs before any Start.
Disabled scripts run Awake but not Start.
Full Transcript
In Unity, when a game starts, the Awake method is called first on all scripts attached to game objects. This happens even if the scripts are disabled. Awake is used to initialize variables and set up references. After all Awake methods have run, Unity calls the Start method on all enabled scripts. Start is used to begin gameplay logic. This order ensures all objects are ready before gameplay begins. The execution table shows Awake calls first on all scripts, then Start calls. Variables like isInitialized become true after Awake, while isReady becomes true after Start. If a script is disabled, Awake still runs but Start does not. This helps avoid errors from uninitialized objects during gameplay.