I'm a little confused about the order of execution when using "LoadLevel()" with an class using "DontDestroyOnLoad()".
I know that Awake() is always before OnEnable() or Start(), but it seems that I have to use "OnEnable()" after a level load to access objects in the scene because it won't find them in Awake().
Again, I only have this problem when using DontDestroyOnLoad().
Any help will be greatly appreciated! Stephane
Thanks for your help SuperCheese. So if I understand correctly, Awake() is the first function called after using LoadLevel()? Or is Awake() called before LoadLevel()? If Awake() is called before the level loads, then it makes sense that I can't find my objects when looking them up in Awake(), as they don't exist yet.
– ronronmxSuperCheese thanks a lot for your help! You are right about Awake() and Start() not being called again in a class using DontDestroyOnLoad(). Since I was doing all my caching either in Awake() or Start(), it never got ran again after a level load. By adding the same code to OnLevelWasLoaded(), it works like intended. Thanks again!
– ronronmx