Challenge - 5 Problems
Unity Lifecycle Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
Order of Awake and Start in Unity
What is the output order when the following Unity script runs?
Unity
using UnityEngine; public class TestOrder : MonoBehaviour { void Awake() { Debug.Log("Awake called"); } void Start() { Debug.Log("Start called"); } }
Attempts:
2 left
💡 Hint
Awake is called before Start in Unity's lifecycle.
✗ Incorrect
In Unity, Awake is called first when the script instance is loaded, then Start is called before the first frame update.
🧠 Conceptual
intermediate2:00remaining
Purpose of Awake vs Start
Which statement best describes the difference between Awake and Start methods in Unity?
Attempts:
2 left
💡 Hint
Think about when each method is called during the script lifecycle.
✗ Incorrect
Awake is called when the script instance is loaded, before any Start methods. Start is called before the first frame update, after all Awake calls.
❓ Predict Output
advanced2:00remaining
Execution order with multiple scripts
Given two scripts attached to different GameObjects, what is the order of output?
Unity
using UnityEngine; public class ScriptA : MonoBehaviour { void Awake() { Debug.Log("ScriptA Awake"); } void Start() { Debug.Log("ScriptA Start"); } } public class ScriptB : MonoBehaviour { void Awake() { Debug.Log("ScriptB Awake"); } void Start() { Debug.Log("ScriptB Start"); } }
Attempts:
2 left
💡 Hint
Awake is called on all scripts before any Start is called.
✗ Incorrect
Unity calls Awake on all scripts first, then calls Start on all scripts. The order of Awake calls depends on script execution order or scene hierarchy but Awake always precedes Start.
🔧 Debug
advanced2:00remaining
Why Start is not called?
Why does the Start method not get called in this script attached to a disabled GameObject?
Unity
using UnityEngine; public class DisabledStart : MonoBehaviour { void Awake() { Debug.Log("Awake called"); } void Start() { Debug.Log("Start called"); } }
Attempts:
2 left
💡 Hint
Think about when Unity calls Start relative to GameObject activation.
✗ Incorrect
Start is called only if the GameObject is active when the scene starts. If the GameObject is disabled, Start is delayed until it is enabled.
🧠 Conceptual
expert2:00remaining
Awake and Start with Script Execution Order
If Script Execution Order is set so ScriptB runs before ScriptA, which statement is true about Awake and Start calls?
Attempts:
2 left
💡 Hint
Consider Unity's lifecycle and how Script Execution Order affects Awake and Start.
✗ Incorrect
Unity calls Awake methods in Script Execution Order, but Start methods are called only after all Awake calls complete, regardless of order.