0
0
Unityframework~20 mins

Trigger vs collision detection in Unity - Practice Questions

Choose your learning style9 modes available
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.