Bird
Raised Fist0
Unityframework~20 mins

Why 3D expands game possibilities in Unity - Challenge Your Understanding

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Challenge - 5 Problems
🎖️
3D Game Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
3D Object Movement Output

What will be the output of the following Unity C# script when attached to a 3D object?

using UnityEngine;

public class MoveObject : MonoBehaviour {
    void Start() {
        transform.position = new Vector3(1, 2, 3);
        Debug.Log(transform.position);
    }
}
Unity
using UnityEngine;

public class MoveObject : MonoBehaviour {
    void Start() {
        transform.position = new Vector3(1, 2, 3);
        Debug.Log(transform.position);
    }
}
A(1, 2)
B(1.0, 2.0, 3.0)
CVector3(1, 2, 3)
DError: transform.position is read-only
Attempts:
2 left
💡 Hint

Check how Vector3 is printed in Unity's Debug.Log.

🧠 Conceptual
intermediate
1:30remaining
Why 3D Allows More Game Possibilities

Which of the following best explains why 3D expands game possibilities compared to 2D?

A3D allows movement and interaction along three axes, enabling more complex environments and gameplay.
B3D games always run faster than 2D games.
C3D games use fewer resources than 2D games.
D3D games do not require physics engines.
Attempts:
2 left
💡 Hint

Think about how adding depth changes player movement and game design.

🔧 Debug
advanced
2:30remaining
Fix the 3D Rotation Bug

What error will occur when running this Unity C# code to rotate a 3D object?

using UnityEngine;

public class RotateObject : MonoBehaviour {
    void Update() {
        transform.Rotate(0, 90, 0 * Time.deltaTime);
    }
}
Unity
using UnityEngine;

public class RotateObject : MonoBehaviour {
    void Update() {
        transform.Rotate(0, 90, 0 * Time.deltaTime);
    }
}
AThe object rotates too fast because Time.deltaTime is not applied correctly.
BSyntaxError: Missing semicolon after Rotate method call.
CRuntime error: transform.Rotate does not accept three arguments.
DThe object does not rotate because the z-axis rotation is zero.
Attempts:
2 left
💡 Hint

Look carefully at how multiplication with Time.deltaTime is applied.

📝 Syntax
advanced
1:30remaining
Identify the Syntax Error in 3D Vector Initialization

Which option contains a syntax error when initializing a Vector3 in Unity C#?

AVector3 pos = new Vector3(1f, 2f, 3f);
BVector3 pos = new Vector3(x:1, y:2, z:3);
CVector3 pos = Vector3(1, 2, 3);
DVector3 pos = new Vector3(1, 2, 3);
Attempts:
2 left
💡 Hint

Remember how to properly create new objects in C#.

🚀 Application
expert
3:00remaining
Calculate Distance in 3D Space

Given two points in 3D space, pointA = (1, 2, 3) and pointB = (4, 6, 8), which code snippet correctly calculates the distance between them in Unity C#?

Afloat dist = (pointB - pointA).Length();
Bfloat dist = Mathf.Sqrt((4-1)+(6-2)+(8-3));
Cfloat dist = Vector3.Magnitude(pointB - pointA);
Dfloat dist = Vector3.Distance(pointA, pointB);
Attempts:
2 left
💡 Hint

Check Unity's built-in methods for distance calculation.

Practice

(1/5)
1. Why does adding 3D to a game expand its possibilities compared to 2D?
easy
A. Because 3D removes the need for player input.
B. Because 3D games use fewer resources than 2D games.
C. Because 3D adds depth, allowing movement and interaction in three directions.
D. Because 3D games only use flat images like 2D games.

Solution

  1. Step 1: Understand 2D vs 3D space

    2D games have width and height, but 3D adds depth, creating a three-dimensional space.
  2. Step 2: Recognize how 3D affects gameplay

    With depth, players can move and interact in more directions, making the game more immersive and complex.
  3. Final Answer:

    Because 3D adds depth, allowing movement and interaction in three directions. -> Option C
  4. Quick Check:

    3D adds depth = More movement options [OK]
Hint: 3D means depth, so more ways to move and interact [OK]
Common Mistakes:
  • Thinking 3D uses fewer resources than 2D
  • Believing 3D is just flat images
  • Assuming 3D removes player input
2. Which of the following is the correct way to represent a 3D position in Unity?
easy
A. Vector3(x, y, z)
B. Vector2(x, y)
C. Vector4(x, y, z, w)
D. Vector1(x)

Solution

  1. Step 1: Recall Unity's vector types

    Unity uses Vector2 for 2D positions (x, y) and Vector3 for 3D positions (x, y, z).
  2. Step 2: Identify the correct vector for 3D

    Since 3D space requires three coordinates, Vector3(x, y, z) is the correct choice.
  3. Final Answer:

    Vector3(x, y, z) -> Option A
  4. Quick Check:

    3D position = Vector3 [OK]
Hint: 3D needs three coordinates, so use Vector3 [OK]
Common Mistakes:
  • Using Vector2 for 3D positions
  • Confusing Vector4 with position vectors
  • Using Vector1 which is invalid for positions
3. What will be the output of this Unity C# code snippet?
Vector3 position = new Vector3(1, 2, 3);
position.z += 5;
Debug.Log(position);
medium
A. (1.0, 7.0, 3.0)
B. (1.0, 2.0, 3.0)
C. (6.0, 2.0, 3.0)
D. (1.0, 2.0, 8.0)

Solution

  1. Step 1: Understand initial Vector3 values

    The vector starts at (1, 2, 3).
  2. Step 2: Apply the z increment

    Adding 5 to z changes it from 3 to 8, so the vector becomes (1, 2, 8).
  3. Final Answer:

    (1.0, 2.0, 8.0) -> Option D
  4. Quick Check:

    z = 3 + 5 = 8 [OK]
Hint: Add 5 to z coordinate only [OK]
Common Mistakes:
  • Adding 5 to x or y instead of z
  • Not updating the vector after increment
  • Confusing vector components order
4. Identify the error in this Unity C# code that tries to move an object forward in 3D space:
transform.position = transform.position + Vector3.forward * speed * Time.deltaTime;
medium
A. Missing semicolon at the end of the line.
B. The code is correct and will move the object forward.
C. Vector3.forward is not a valid direction in Unity.
D. Time.deltaTime should not be used for movement.

Solution

  1. Step 1: Check syntax correctness

    The line ends with a semicolon and uses valid syntax.
  2. Step 2: Verify logic for moving forward

    Vector3.forward is a built-in direction (0, 0, 1), speed and Time.deltaTime scale movement correctly.
  3. Final Answer:

    The code is correct and will move the object forward. -> Option B
  4. Quick Check:

    Valid syntax and logic = correct code [OK]
Hint: Vector3.forward moves forward; Time.deltaTime smooths movement [OK]
Common Mistakes:
  • Thinking Vector3.forward is invalid
  • Forgetting semicolon (but here it is present)
  • Misunderstanding Time.deltaTime usage
5. You want to create a 3D game where the player can move freely in all directions and look around smoothly. Which Unity features help achieve this best?
hard
A. Use Vector3 for position, Quaternion for rotation, and transform.Translate for movement.
B. Use Vector2 for position and Euler angles for rotation only.
C. Use only Rigidbody without any transform changes.
D. Use 2D physics and ignore the z-axis.

Solution

  1. Step 1: Identify 3D position and rotation tools

    Vector3 handles 3D positions; Quaternion handles smooth 3D rotations without gimbal lock.
  2. Step 2: Choose movement method

    transform.Translate moves objects in 3D space easily and smoothly.
  3. Final Answer:

    Use Vector3 for position, Quaternion for rotation, and transform.Translate for movement. -> Option A
  4. Quick Check:

    3D movement needs Vector3 + Quaternion + transform.Translate [OK]
Hint: 3D movement = Vector3 + Quaternion + transform.Translate [OK]
Common Mistakes:
  • Using Vector2 which lacks depth
  • Ignoring rotation or using Euler angles causing issues
  • Relying only on Rigidbody without transform updates