0
0
Unityframework~20 mins

3D coordinate system in Unity - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
3D Coordinate Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2: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);
    }
}
A(3.0, 7.0, 9.0)
B(5.0, 7.0, 9.0)
C(4.0, 5.0, 6.0)
D(1.0, 2.0, 3.0)
Attempts:
2 left
💡 Hint
Remember that Vector3 addition adds each coordinate separately.
🧠 Conceptual
intermediate
1: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)?
AX axis
BNegative Y axis
CY axis
DZ axis
Attempts:
2 left
💡 Hint
Think about which axis controls height in the scene view.
🔧 Debug
advanced
2: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;
    }
}
ABecause move.normalized changes the vector length to 1, so it moves only 1 unit forward.
BBecause transform.position cannot be changed directly.
CBecause the vector should be multiplied by Time.deltaTime.
DBecause the vector should be added without normalization.
Attempts:
2 left
💡 Hint
Check what normalized does to a vector's length.
📝 Syntax
advanced
1: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.
AVector3 left = new Vector3(0, -1, 0);
BVector3 left = new Vector3(0, 0, -1);
CVector3 left = new Vector3(1, 0, 0);
DVector3 left = new Vector3(-1, 0, 0);
Attempts:
2 left
💡 Hint
Left means negative direction along the X axis.
🚀 Application
expert
3: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?
A24
B9
C12
D18
Attempts:
2 left
💡 Hint
Multiply the number of iterations in each loop.