0
0
Unityframework~10 mins

Why Unity is the leading game engine - Test Your Understanding

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

Complete the code to print the Unity version.

Unity
Debug.Log("Unity version: " + Application.[1]);
Drag options to blanks, or click blank then click option'
AdataPath
Bplatform
CunityVersion
DproductName
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'platform' instead of 'unityVersion' returns the platform name, not version.
Using 'dataPath' returns the data folder path, not version.
2fill in blank
medium

Complete the code to create a new GameObject named "Player".

Unity
GameObject [1] = new GameObject("Player");
Drag options to blanks, or click blank then click option'
AplayerObject
Bplayer
CPlayer
DnewPlayer
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Player' as variable name can confuse with class name.
Using 'newPlayer' is valid but less common.
3fill in blank
hard

Fix the error in the code to add a Rigidbody component to a GameObject.

Unity
Rigidbody rb = gameObject.[1]<Rigidbody>();
Drag options to blanks, or click blank then click option'
AAddComponent
BGetComponent
CRemoveComponent
DFindComponent
Attempts:
3 left
💡 Hint
Common Mistakes
Using GetComponent returns existing component, does not add new.
RemoveComponent is not a valid method.
4fill in blank
hard

Complete the code to check if the player pressed the space key and print a message.

Unity
if (Input.[1](KeyCode.Space)) {
    Debug.Log("Space key pressed!");
}
Drag options to blanks, or click blank then click option'
AGetKeyDown
BGetKeyUp
CGetKey
DIsKeyPressed
Attempts:
3 left
💡 Hint
Common Mistakes
Using GetKey returns true while key is held down, not just pressed once.
GetKeyUp detects key release, not press.
5fill in blank
hard

Fill all three blanks to create a dictionary of player scores with condition.

Unity
var highScores = new Dictionary<string, int> {
    {"Alice", 90},
    {"Bob", 75},
    {"Charlie", 85}
}.Where(kv => kv.Value [1] [2]).ToDictionary(kv => kv.Key, kv => kv.Value [3] 5);
Drag options to blanks, or click blank then click option'
A>
B80
C+
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' filters scores below threshold, not above.
Using '-' instead of '+' decreases scores.