Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using spaces instead of commas
Adding brackets around the values
✗ Incorrect
In Unity, Vector3 constructor takes three float values separated by commas without brackets.
2fill in blank
mediumComplete 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using negative values to move forward
Using zero which causes no movement
✗ Incorrect
To move 5 units forward along the z-axis, add 5 to the z component.
3fill in blank
hardFix 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around numbers
Assigning a Vector3 instead of a float
✗ Incorrect
The y component should be assigned a numeric value 10, not a string or expression.
4fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping x and y values
Using negative values for up
✗ Incorrect
A vector pointing straight up has x=0 and y=1.
5fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using original values without scaling
Mixing up the order of coordinates
✗ Incorrect
Scaling (1, 3, 4) by 2 gives (2, 6, 8).