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
Recall & Review
beginner
What is a particle collision in Unity's Particle System?
A particle collision happens when particles in a Particle System hit other objects or surfaces in the scene. Unity can detect these collisions and trigger events or effects.
Click to reveal answer
beginner
How do you enable collision detection for particles in Unity?
You enable collision by selecting the Particle System, then in the Inspector, check the 'Collision' module and configure its settings like type, quality, and colliders.
Click to reveal answer
intermediate
What does the 'Collision Type' setting control in Unity's Particle System?
It controls what the particles collide with. Options include 'World' (scene objects), 'Planes' (custom planes), or 'None' (no collision).
Click to reveal answer
intermediate
What is the purpose of the 'Send Collision Messages' option in Unity's Particle System?
It allows the Particle System to send messages like OnParticleCollision to scripts, so you can respond to collisions with custom code.
Click to reveal answer
intermediate
How can you make particles bounce off surfaces in Unity?
By enabling collision and setting the 'Bounce' value in the Collision module, particles will reflect off surfaces instead of just stopping or dying.
Click to reveal answer
Which module must be enabled to detect particle collisions in Unity?
ACollision
BRenderer
CEmission
DShape
✗ Incorrect
The Collision module controls particle collision detection.
What happens if 'Send Collision Messages' is enabled?
AParticles ignore collisions
BParticles send messages to scripts on collision
CParticles stop emitting
DParticles change color automatically
✗ Incorrect
Enabling this sends OnParticleCollision messages to scripts.
Which collision type lets particles collide with scene objects?
ANone
BPlanes
CCustom
DWorld
✗ Incorrect
'World' means particles collide with objects in the scene.
How do you make particles bounce off surfaces?
ASet Bounce value in Collision module
BEnable Emission module
CChange Shape to Sphere
DDisable Collision module
✗ Incorrect
Bounce controls how particles reflect off surfaces.
What is NOT a valid collision type in Unity's Particle System?
AWorld
BPlanes
CGravity
DNone
✗ Incorrect
'Gravity' is not a collision type; it's a force.
Explain how to set up particle collision in Unity and respond to collisions in code.
Think about the steps from enabling collision to writing code that reacts.
You got /4 concepts.
Describe the effect of the Bounce setting in particle collisions and when you might use it.
Imagine how a ball bounces and relate it to particles.
You got /3 concepts.
Practice
(1/5)
1. What is the main purpose of the OnParticleCollision method in Unity's particle system?
easy
A. To stop the particle system from playing
B. To change the color of particles over time
C. To emit new particles continuously
D. To detect when particles collide with other objects
Solution
Step 1: Understand the role of OnParticleCollision
This method is a special Unity callback triggered when particles hit other objects in the scene.
Step 2: Identify its main use
It is used to detect collisions of particles, allowing you to respond to those events in code.
Final Answer:
To detect when particles collide with other objects -> Option D
Quick Check:
Particle collision detection = To detect when particles collide with other objects [OK]
What will happen when particles collide with another object named "Wall"?
medium
A. The console will print: Hit: Wall
B. The particle system will stop emitting
C. Nothing will happen because OnParticleCollision is not called
D. An error will occur because other.name is invalid
Solution
Step 1: Understand the method behavior
When particles hit an object, OnParticleCollision is called with that object as other.
Step 2: Analyze the Debug.Log statement
The code prints "Hit: " plus the name of the collided object, which is "Wall".
Final Answer:
The console will print: Hit: Wall -> Option A
Quick Check:
Collision triggers log with object name = The console will print: Hit: Wall [OK]
Hint: OnParticleCollision logs object name on hit [OK]
Common Mistakes:
Assuming particle system stops on collision
Thinking method is never called
Believing other.name is invalid
4. Given this code snippet in a Unity script:
void OnParticleCollision(GameObject other) {
int count = other.GetComponent<int>();
Debug.Log(count);
}
What is the problem with this code?
medium
A. OnParticleCollision must return a value
B. GetComponent<int>() is invalid because int is not a component
C. The method should use Collider instead of GameObject
D. Debug.Log cannot print integers
Solution
Step 1: Check GetComponent usage
GetComponent<T> expects a Component type, but int is a primitive type, not a component.
Step 2: Identify the error cause
Using GetComponent<int>() causes a compile-time error because int is invalid here.
Final Answer:
GetComponent<int>() is invalid because int is not a component -> Option B
Quick Check:
GetComponent requires Component type = GetComponent<int>() is invalid because int is not a component [OK]
Hint: GetComponent needs a Component type, not primitives [OK]
Common Mistakes:
Thinking OnParticleCollision must return a value
Confusing parameter type with Collider
Believing Debug.Log can't print integers
5. You want to reduce the damage caused by particles when they collide with enemies, but only if the enemy's health is above 50. Which approach correctly uses OnParticleCollision to achieve this?
hard
A. Check the particle system's emission rate and reduce damage if emission is low.
B. Use OnParticleCollision() without parameters and reduce damage always.
C. In OnParticleCollision(GameObject other), get the enemy's health component, check if health > 50, then reduce damage accordingly.
D. Use OnParticleCollision(Collider other) and reduce damage without checking health.
Solution
Step 1: Use correct method signature
The method must be OnParticleCollision(GameObject other) to get the collided object.
Step 2: Access enemy health and apply condition
Retrieve the health component from other, check if health > 50, then reduce damage only in that case.
Final Answer:
In OnParticleCollision(GameObject other), get the enemy's health component, check if health > 50, then reduce damage accordingly. -> Option C
Quick Check:
Conditional damage based on health = In OnParticleCollision(GameObject other), get the enemy's health component, check if health > 50, then reduce damage accordingly. [OK]
Hint: Check enemy health inside OnParticleCollision before damage [OK]