Challenge - 5 Problems
3D Coordinate Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
What is the output of this Vector3 addition?
Consider the following Unity C# code snippet. What will be printed to the console?
Unity
using UnityEngine; public class TestVector : MonoBehaviour { void Start() { Vector3 a = new Vector3(1, 2, 3); Vector3 b = new Vector3(4, 5, 6); Vector3 c = a + b; Debug.Log(c); } }
Attempts:
2 left
💡 Hint
Remember that Vector3 addition adds each coordinate separately.
✗ Incorrect
Adding two Vector3 objects sums their x, y, and z components respectively. So (1+4, 2+5, 3+6) = (5,7,9).
🧠 Conceptual
intermediate1:00remaining
Which axis points upwards in Unity's 3D coordinate system?
In Unity's default 3D coordinate system, which axis represents the vertical direction (up)?
Attempts:
2 left
💡 Hint
Think about which axis controls height in the scene view.
✗ Incorrect
In Unity, the Y axis points upwards, representing vertical height.
🔧 Debug
advanced2:30remaining
Why does this code produce an unexpected movement?
This code is intended to move an object 5 units forward along the Z axis, but it moves only 1 unit forward instead. Why?
Unity
using UnityEngine; public class MoveObject : MonoBehaviour { void Start() { Vector3 move = new Vector3(0, 0, 5); transform.position += move.normalized; } }
Attempts:
2 left
💡 Hint
Check what normalized does to a vector's length.
✗ Incorrect
Normalizing a vector changes its length to 1 but keeps direction. So adding move.normalized moves the object 1 unit, not 5, along the same direction.
📝 Syntax
advanced1:30remaining
Which code correctly creates a Vector3 pointing left?
Select the code snippet that correctly creates a Vector3 pointing left in Unity's 3D space.
Attempts:
2 left
💡 Hint
Left means negative direction along the X axis.
✗ Incorrect
In Unity, the X axis points right, so left is negative X: (-1, 0, 0).
🚀 Application
expert3:00remaining
How many unique Vector3 points are generated by this nested loop?
Consider this code that generates Vector3 points in a 3D grid:
int count = 0;
for (int x = 0; x < 3; x++) {
for (int y = 0; y < 2; y++) {
for (int z = 0; z < 4; z++) {
Vector3 point = new Vector3(x, y, z);
count++;
}
}
}
What is the value of count after this code runs?
Attempts:
2 left
💡 Hint
Multiply the number of iterations in each loop.
✗ Incorrect
The loops run 3 * 2 * 4 = 24 times, so count is 24.