0
0
Unityframework~20 mins

3D colliders in Unity - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
3D Collider 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 OnCollisionEnter method?

Consider a Unity script attached to a GameObject with a BoxCollider and Rigidbody. What will be printed when this object collides with another?

Unity
void OnCollisionEnter(Collision collision) {
    Debug.Log($"Collided with {collision.gameObject.name}");
}
AError: collision is null
BCollided with null
CNo output, method not called
DCollided with Player
Attempts:
2 left
💡 Hint

OnCollisionEnter is called only when both objects have colliders and at least one has a Rigidbody.

🧠 Conceptual
intermediate
1:30remaining
Which collider type allows trigger events but does not physically block objects?

In Unity 3D, which collider type lets objects pass through but still detects overlaps for events?

AMeshCollider with convex set to false
BBoxCollider with isTrigger set to true
CSphereCollider with isTrigger set to false
DCapsuleCollider with isTrigger set to false
Attempts:
2 left
💡 Hint

Triggers detect overlaps but do not cause physical collisions.

🔧 Debug
advanced
2:00remaining
Why does this OnTriggerEnter method never get called?

Given this script on a GameObject with a SphereCollider set as trigger, why is OnTriggerEnter not called when another object enters?

Unity
void OnTriggerEnter(Collider other) {
    Debug.Log("Trigger entered by " + other.gameObject.name);
}
AThe other object does not have a Rigidbody component
BThe SphereCollider is not set as trigger
CThe script is not attached to any GameObject
DThe method signature is incorrect
Attempts:
2 left
💡 Hint

Triggers require at least one Rigidbody involved in the collision.

📝 Syntax
advanced
1:00remaining
Which option correctly defines a MeshCollider as convex in C#?

Choose the correct syntax to set a MeshCollider's convex property to true in a Unity script.

Unity
MeshCollider meshCollider = gameObject.GetComponent<MeshCollider>();
AmeshCollider.Convex = true;
BmeshCollider.setConvex(true);
CmeshCollider.convex = true;
DmeshCollider.convex(true);
Attempts:
2 left
💡 Hint

Properties in C# are accessed without parentheses.

🚀 Application
expert
2:30remaining
How many colliders are active after this code runs?

Given a GameObject with 1 BoxCollider and 1 SphereCollider, this code disables the BoxCollider and adds a CapsuleCollider. How many colliders are active?

Unity
BoxCollider box = gameObject.GetComponent<BoxCollider>();
box.enabled = false;
CapsuleCollider capsule = gameObject.AddComponent<CapsuleCollider>();
A2
B0
C3
D1
Attempts:
2 left
💡 Hint

Disabling a collider stops it from being active but does not remove it.