0
0
Unityframework~10 mins

Awake vs Start execution order in Unity - Interactive Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to print a message in the Awake method.

Unity
void Awake() {
    Debug.Log([1]);
}
Drag options to blanks, or click blank then click option'
AAwake called
B"Awake called"
CAwake()
DDebug.Log("Awake called")
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting the quotes around the string.
Passing a method name instead of a string.
2fill in blank
medium

Complete the code to print a message in the Start method.

Unity
void Start() {
    Debug.Log([1]);
}
Drag options to blanks, or click blank then click option'
AStart()
BStart called
C"Start called"
DDebug.Log("Start called")
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the message without quotes.
Trying to call Debug.Log inside its own argument.
3fill in blank
hard

Fix the error in the Awake method to correctly print the message.

Unity
void Awake() {
    Debug.Log([1]);
}
Drag options to blanks, or click blank then click option'
A"Awake executed"
BDebug.Log("Awake executed")
CAwake executed
DAwake()
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the message without quotes causing a compile error.
Trying to call Debug.Log inside the argument.
4fill in blank
hard

Fill both blanks to create a MonoBehaviour that prints messages in Awake and Start.

Unity
public class Example : MonoBehaviour {
    void Awake() {
        Debug.Log([1]);
    }
    void Start() {
        Debug.Log([2]);
    }
}
Drag options to blanks, or click blank then click option'
A"Awake message"
B"Start message"
CAwake message
DStart message
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting quotes around messages.
Using unquoted words causing errors.
5fill in blank
hard

Fill all three blanks to create a script that prints Awake, Start, and Update messages.

Unity
public class Lifecycle : MonoBehaviour {
    void Awake() {
        Debug.Log([1]);
    }
    void Start() {
        Debug.Log([2]);
    }
    void Update() {
        Debug.Log([3]);
    }
}
Drag options to blanks, or click blank then click option'
A"Awake called"
B"Start called"
C"Update called"
DUpdate called
Attempts:
3 left
💡 Hint
Common Mistakes
Leaving out quotes causing compile errors.
Using unquoted words as arguments.