0
0
Unityframework~10 mins

3D coordinate system in Unity - Interactive Code Practice

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

Complete the code to create a Vector3 at position (1, 2, 3).

Unity
Vector3 position = new Vector3([1]);
Drag options to blanks, or click blank then click option'
A[1, 2, 3]
B1 2 3
C(1, 2, 3)
D1, 2, 3
Attempts:
3 left
💡 Hint
Common Mistakes
Using spaces instead of commas
Adding brackets around the values
2fill in blank
medium

Complete the code to move an object 5 units along the positive z-axis.

Unity
transform.position += new Vector3(0, 0, [1]);
Drag options to blanks, or click blank then click option'
A0
B5
C-5
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Using negative values to move forward
Using zero which causes no movement
3fill in blank
hard

Fix the error in the code to correctly set the y position to 10.

Unity
Vector3 pos = transform.position;
pos.y = [1];
transform.position = pos;
Drag options to blanks, or click blank then click option'
AVector3(0, 10, 0)
B"10"
C10
Dpos.y = 10
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around numbers
Assigning a Vector3 instead of a float
4fill in blank
hard

Fill both blanks to create a Vector3 pointing up with length 1.

Unity
Vector3 up = new Vector3([1], [2], 0);
Drag options to blanks, or click blank then click option'
A0
B1
C-1
D2
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping x and y values
Using negative values for up
5fill in blank
hard

Fill all three blanks to create a Vector3 scaled by 2 from (1, 3, 4).

Unity
Vector3 scaled = new Vector3([1], [2], [3]);
Drag options to blanks, or click blank then click option'
A1
B6
C8
D2
Attempts:
3 left
💡 Hint
Common Mistakes
Using original values without scaling
Mixing up the order of coordinates