0
0
UnityComparisonBeginner · 4 min read

Start vs Awake in Unity: Key Differences and When to Use Each

In Unity, Awake is called when the script instance is loaded, before any Start methods run. Start is called before the first frame update and only if the script is enabled, making Awake ideal for early setup and Start for initialization that depends on other objects.
⚖️

Quick Comparison

This table summarizes the main differences between Awake and Start methods in Unity.

FactorAwakeStart
Execution TimeCalled when script instance loadsCalled before first frame update
Execution OrderRuns before all Start methodsRuns after all Awake methods
Called If Script Enabled?Yes, always calledOnly if script is enabled
Use CaseInitialize variables and referencesInitialize logic that depends on other objects
FrequencyCalled once per script instanceCalled once per script instance
Access to Other ComponentsOther components may not be initializedOther components are initialized
⚖️

Key Differences

Awake is called immediately when the script instance is loaded, even if the script component is disabled. This makes it perfect for setting up internal references or variables that do not depend on other objects.

Start is called just before the first frame update but only if the script is enabled. This means Start is ideal for initialization that requires other objects or components to be fully initialized and active.

Another key difference is the execution order: all Awake methods run before any Start methods. This ensures that all objects have set up their internal state before any gameplay logic begins.

💻

Awake Example

csharp
using UnityEngine;

public class ExampleAwake : MonoBehaviour
{
    private Rigidbody rb;

    void Awake()
    {
        // Cache the Rigidbody component early
        rb = GetComponent<Rigidbody>();
        Debug.Log("Awake called: Rigidbody cached.");
    }

    void Start()
    {
        Debug.Log("Start called: Rigidbody is " + (rb != null ? "ready" : "missing"));
    }
}
Output
Awake called: Rigidbody cached. Start called: Rigidbody is ready
↔️

Start Equivalent

csharp
using UnityEngine;

public class ExampleStart : MonoBehaviour
{
    private Rigidbody rb;

    void Start()
    {
        // Cache the Rigidbody component here
        rb = GetComponent<Rigidbody>();
        Debug.Log("Start called: Rigidbody cached.");
    }
}
Output
Start called: Rigidbody cached.
🎯

When to Use Which

Choose Awake when you need to initialize variables or references as soon as the script loads, regardless of whether the script is enabled. This is useful for setting up internal states or caching components.

Choose Start when your initialization depends on other objects or components being fully initialized and active. Use Start for gameplay logic that requires other scripts to be ready.

In summary, use Awake for early setup and Start for initialization that depends on the scene's active state.

Key Takeaways

Awake runs first when the script loads, even if disabled.
Start runs before the first frame but only if enabled.
Awake is best for internal setup; Start for dependent initialization.
All Awake calls finish before any Start runs.
Use Start for logic needing other objects fully ready.