0
0
Unityframework~10 mins

Creating and naming GameObjects 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 create a new GameObject named "Player".

Unity
GameObject player = new GameObject([1]);
Drag options to blanks, or click blank then click option'
A"Player"
BPlayer
C'Player'
Dplayer
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting the quotes around the name.
Using single quotes instead of double quotes.
Passing a variable name instead of a string.
2fill in blank
medium

Complete the code to rename an existing GameObject to "Enemy".

Unity
gameObject.[1] = "Enemy";
Drag options to blanks, or click blank then click option'
Aname
BSetName
CRename
DgameObjectName
Attempts:
3 left
💡 Hint
Common Mistakes
Trying to call a method instead of setting a property.
Using incorrect property names like SetName.
3fill in blank
hard

Fix the error in the code to create a GameObject named "Bullet".

Unity
GameObject bullet = new GameObject([1]);
Drag options to blanks, or click blank then click option'
Abullet
BBullet
C'Bullet'
D"Bullet"
Attempts:
3 left
💡 Hint
Common Mistakes
Using the name without quotes causes a compile error.
Using single quotes instead of double quotes.
4fill in blank
hard

Fill both blanks to create a GameObject named "Coin" and then rename it to "GoldCoin".

Unity
GameObject coin = new GameObject([1]);
coin.[2] = "GoldCoin";
Drag options to blanks, or click blank then click option'
A"Coin"
BSetName
Cname
Dcoin
Attempts:
3 left
💡 Hint
Common Mistakes
Using a method instead of the name property to rename.
Forgetting quotes around the initial name.
5fill in blank
hard

Fill all three blanks to create a GameObject named "Tree", rename it to "OakTree", and then print its name.

Unity
GameObject tree = new GameObject([1]);
tree.[2] = "OakTree";
Debug.Log(tree.[3]);
Drag options to blanks, or click blank then click option'
A"Tree"
Bname
DSetName
Attempts:
3 left
💡 Hint
Common Mistakes
Using a method instead of the name property.
Forgetting quotes around the initial name.
Trying to print a method instead of the property.