0
0
Unityframework~5 mins

Debug.Log for debugging in Unity - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is Debug.Log used for in Unity?

Debug.Log is used to print messages to the Console window in Unity. It helps developers see values and messages while the game runs, making it easier to find and fix problems.

Click to reveal answer
beginner
How do you print the value of a variable score using Debug.Log?

You write Debug.Log("Score: " + score); This shows the text "Score:" followed by the current value of score in the Console.

Click to reveal answer
intermediate
What is the difference between Debug.Log, Debug.LogWarning, and Debug.LogError?

Debug.Log prints normal messages.<br>Debug.LogWarning prints warning messages that highlight potential issues.<br>Debug.LogError prints error messages that show serious problems.

Click to reveal answer
intermediate
Can Debug.Log slow down your game if used too much? Why?

Yes. Printing many messages every frame can slow the game because writing to the Console takes time. Use Debug.Log carefully and remove or limit it in final builds.

Click to reveal answer
beginner
How do you clear the Console window in Unity?

You click the Clear button at the top of the Console window. This removes all previous messages so you can see new ones clearly.

Click to reveal answer
What does Debug.Log do in Unity?
AChanges the game score
BPrints messages to the Console window
CStarts the game
DStops the game
Which Debug method shows an error message?
ADebug.LogWarning
BDebug.Log
CDebug.LogError
DDebug.Clear
How do you print the value of a variable health using Debug.Log?
ADebug.Log(health);
BDebug.Log("health");
CDebug.Log(health + "Health");
DDebug.Log("Health: " + health);
What happens if you use Debug.Log too much in your game?
AThe game may slow down
BThe game runs faster
CThe Console clears automatically
DThe game crashes immediately
Where do Debug.Log messages appear in Unity?
AIn the Console window
BIn the Scene view
CIn the Inspector window
DIn the Project window
Explain how Debug.Log helps you find problems in your Unity game.
Think about how seeing messages can tell you what your game is doing.
You got /4 concepts.
    Describe the difference between Debug.Log, Debug.LogWarning, and Debug.LogError.
    Consider how each type signals different levels of issues.
    You got /4 concepts.