OnLevelWasLoaded - Before or after Awake/Start?

Does anyone know whether OnLevelWasLoaded is called before or after Awake/Start is called on the objects in the level?

  1. Awake
  2. Start
  3. Update begins

Where in an ordered list like that would OnLevelWasLoaded fall?

Thanks in advance!

function Awake ()
{
Debug.Log (“Awake”);
}

function Start ()
{
Debug.Log (“Start”);
}

function OnLevelWasLoaded ()
{
Debug.Log (“OnLevelWasLoaded”);
}

Console :

  • OnLevelWasLoaded
  • Awake
  • Start

Note : If the scene is the first scene, it seems OnLevelWasLoaded do not trigger. This function seems to be triggered only by Application.LoadLevel.

2 Likes

Thanks :smile:

I saw how you did it and then /facepalm’ed myself for even coming to the forums with this one, hehe.

1 Like

Well, I will simply say Debug.Log ()/ print () are powerful debug tools :wink: