Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting the quotes around the string.
Passing a method name instead of a string.
✗ Incorrect
The Debug.Log method requires a string argument in quotes to print the message.
2fill in blank
mediumComplete 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the message without quotes.
Trying to call Debug.Log inside its own argument.
✗ Incorrect
Debug.Log needs a string argument in quotes to print the message correctly.
3fill in blank
hardFix 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the message without quotes causing a compile error.
Trying to call Debug.Log inside the argument.
✗ Incorrect
The message must be a string in quotes passed to Debug.Log.
4fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting quotes around messages.
Using unquoted words causing errors.
✗ Incorrect
Both Debug.Log calls need string literals in quotes to print messages.
5fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Leaving out quotes causing compile errors.
Using unquoted words as arguments.
✗ Incorrect
All Debug.Log calls require string literals in quotes to print messages correctly.