Awake vs. Start

Scripting API in Unity provides a set of initialization functions.

Initialization functions are the functions that are called at the start of the script lifecycle.

Initialization functions in Unity are 'Awake' and 'Start'.

'Awake' vs. 'Start'

The differences between 'Awake' and 'Start' are execution order and run conditions.

The function 'Awake' runs first, regardless if the script is enabled or not, and the function 'Start' only runs when the script is enabled. Both functions run before the first 'Update' method.

    void Awake()
        Debug.Log("Awake runs first");

    void Start()
        Debug.Log("Start runds second");

Function 'Start' can also be a Coroutine (by replacing 'void' with 'IEnumerator' and adding a 'yield' parameter), but function 'Awake' can not.

    IEnumerator Start()
        //Wait 1 second before running the next code
        yield return new WaitForSeconds(1);



Both functions are useful for initialization purposes (e.g. assigning private variables, spawning game objects, etc.), and when used in combination, can help to implement a wide variety of scenarios.