Bird
Raised Fist0
Unityframework~20 mins

Trigger vs collision detection in Unity - Practice Questions

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
🎖️
Trigger vs Collision Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Difference between Trigger and Collision in Unity
In Unity, what is the main difference between a collider set as a trigger and a collider used for collision detection?
AA trigger collider applies physics forces on contact, while a collision collider only detects overlaps without physical response.
BTrigger colliders are used only for static objects, while collision colliders are for moving objects.
CBoth trigger and collision colliders apply physics forces but triggers only work with 2D objects.
DA trigger collider detects overlaps without physical response, while a collision collider detects physical impacts and applies physics forces.
Attempts:
2 left
💡 Hint
Think about whether the object physically reacts when touching the collider.
query_result
intermediate
2:00remaining
Output of OnTriggerEnter vs OnCollisionEnter
Given a Unity script attached to a GameObject with a collider set as a trigger, what method will be called when another collider enters it?
Unity
void OnTriggerEnter(Collider other) {
    Debug.Log("Triggered by " + other.name);
}

void OnCollisionEnter(Collision collision) {
    Debug.Log("Collided with " + collision.gameObject.name);
}
ABoth OnTriggerEnter and OnCollisionEnter will be called.
BOnCollisionEnter will be called and log the other collider's name.
COnTriggerEnter will be called and log the other collider's name.
DNeither method will be called.
Attempts:
2 left
💡 Hint
Check if the collider is set as a trigger or not.
📝 Syntax
advanced
2:00remaining
Correct method signature for collision detection
Which of the following method signatures is correct for detecting collisions in a Unity C# script?
Avoid OnCollisionEnter(Collision collision) {}
Bvoid OnTriggerEnter(Collider collision, int count) {}
Cvoid OnTriggerEnter(Collision collision) {}
Dvoid OnCollisionEnter(Collider collision) {}
Attempts:
2 left
💡 Hint
Check the parameter type required by Unity for collision events.
optimization
advanced
2:00remaining
Optimizing physics checks with triggers vs collisions
Which approach is generally better for performance when you only need to detect if an object enters an area without physical interaction?
ADisable all colliders and use raycasting instead.
BUse a trigger collider to detect entry without physics calculations.
CUse a collision collider to detect entry and apply physics forces.
DUse both trigger and collision colliders simultaneously for accuracy.
Attempts:
2 left
💡 Hint
Think about physics calculations and when they are necessary.
🔧 Debug
expert
2:00remaining
Why OnTriggerEnter is not called?
A developer has a GameObject with a collider set as trigger and a Rigidbody component. Another GameObject with a collider and Rigidbody moves into it, but OnTriggerEnter is never called. What is the most likely cause?
AOne of the colliders is missing a Rigidbody component or is set to kinematic incorrectly.
BThe OnTriggerEnter method is private instead of public.
CThe colliders are both set as triggers, which disables OnTriggerEnter calls.
DThe script is attached to the wrong GameObject without a collider.
Attempts:
2 left
💡 Hint
Check Rigidbody settings and collider configurations for triggers.

Practice

(1/5)
1. What is the main difference between a trigger and a collision in Unity?
easy
A. Triggers detect overlaps without blocking movement, collisions detect physical contact and block movement.
B. Triggers block movement, collisions only detect overlaps.
C. Triggers require Rigidbody, collisions do not.
D. Triggers and collisions behave exactly the same.

Solution

  1. Step 1: Understand trigger behavior

    Triggers detect when objects overlap but do not physically block each other.
  2. Step 2: Understand collision behavior

    Collisions detect physical contact and prevent objects from passing through each other.
  3. Final Answer:

    Triggers detect overlaps without blocking movement, collisions detect physical contact and block movement. -> Option A
  4. Quick Check:

    Trigger = overlap, Collision = block [OK]
Hint: Triggers overlap only; collisions block movement [OK]
Common Mistakes:
  • Confusing triggers with collisions as both blocking movement
  • Thinking triggers require Rigidbody always
  • Assuming collisions do not block movement
2. Which of the following is the correct way to make a collider act as a trigger in Unity?
easy
A. Add a Rigidbody component only.
B. Disable the collider component.
C. Set the collider's Is Trigger property to true.
D. Set the collider's material to None.

Solution

  1. Step 1: Identify trigger setup

    In Unity, to make a collider a trigger, you must enable its Is Trigger checkbox.
  2. Step 2: Verify other options

    Adding Rigidbody or disabling collider does not make it a trigger; setting material to None affects physics but not trigger behavior.
  3. Final Answer:

    Set the collider's Is Trigger property to true. -> Option C
  4. Quick Check:

    Is Trigger = true for triggers [OK]
Hint: Enable Is Trigger checkbox on collider [OK]
Common Mistakes:
  • Adding Rigidbody alone to make trigger
  • Disabling collider thinking it triggers events
  • Changing material instead of Is Trigger
3. Consider this Unity C# code snippet:
void OnTriggerEnter(Collider other) {
    Debug.Log("Triggered by " + other.name);
}

void OnCollisionEnter(Collision collision) {
    Debug.Log("Collided with " + collision.gameObject.name);
}
What will be printed if an object with a collider marked as trigger overlaps another object with a collider and Rigidbody?
medium
A. No message will print.
B. Only "Collided with [object name]" will print.
C. Both messages will print.
D. Only "Triggered by [object name]" will print.

Solution

  1. Step 1: Analyze trigger event

    When a collider marked as trigger overlaps another collider with Rigidbody, OnTriggerEnter is called.
  2. Step 2: Analyze collision event

    OnCollisionEnter is called only when colliders physically collide (not triggers).
  3. Final Answer:

    Only "Triggered by [object name]" will print. -> Option D
  4. Quick Check:

    Trigger collider calls OnTriggerEnter only [OK]
Hint: Trigger collider calls OnTriggerEnter, not OnCollisionEnter [OK]
Common Mistakes:
  • Expecting both trigger and collision messages
  • Thinking OnCollisionEnter triggers on overlap
  • Confusing collider types for events
4. You wrote this code but OnTriggerEnter is never called:
void OnTriggerEnter(Collider other) {
    Debug.Log("Triggered");
}
What is the most likely reason?
medium
A. The collider is disabled.
B. The collider's Is Trigger property is not enabled.
C. The method name is misspelled.
D. The object has no Rigidbody component.

Solution

  1. Step 1: Check trigger setup

    OnTriggerEnter only fires if the collider has Is Trigger enabled.
  2. Step 2: Verify other conditions

    Rigidbody is needed on one object but missing Rigidbody alone won't prevent OnTriggerEnter if Is Trigger is off; method name is correct; collider disabled would prevent all events.
  3. Final Answer:

    The collider's Is Trigger property is not enabled. -> Option B
  4. Quick Check:

    Is Trigger must be true for OnTriggerEnter [OK]
Hint: Enable Is Trigger to get OnTriggerEnter calls [OK]
Common Mistakes:
  • Forgetting to enable Is Trigger
  • Assuming Rigidbody absence blocks trigger
  • Misspelling method name
  • Not enabling collider component
5. You want to detect when a player enters a zone without blocking their movement, but also detect when the player physically hits a wall. How should you set up the colliders and Rigidbody components?
hard
A. Set the zone collider as trigger (Is Trigger = true), the wall collider as non-trigger, and add Rigidbody to the player.
B. Set both zone and wall colliders as triggers, add Rigidbody to the player.
C. Set the zone collider as non-trigger, wall collider as trigger, and add Rigidbody to the player.
D. Remove Rigidbody from player and set all colliders as non-trigger.

Solution

  1. Step 1: Configure zone for overlap detection

    Set the zone collider's Is Trigger to true so it detects player entering without blocking movement.
  2. Step 2: Configure wall for physical collision

    Set the wall collider as non-trigger to physically block the player.
  3. Step 3: Rigidbody requirement

    Add Rigidbody to the player so physics and trigger events work properly.
  4. Final Answer:

    Set the zone collider as trigger (Is Trigger = true), the wall collider as non-trigger, and add Rigidbody to the player. -> Option A
  5. Quick Check:

    Trigger zone + Rigidbody player + solid wall = correct setup [OK]
Hint: Trigger zone collider, solid wall collider, Rigidbody on player [OK]
Common Mistakes:
  • Making wall a trigger so player passes through
  • Not adding Rigidbody to player
  • Setting zone collider as non-trigger blocking player