Consider this Unity C# script snippet attached to a GameObject with a Particle System. What will be printed when a particle collides with another GameObject?
void OnParticleCollision(GameObject other) {
Debug.Log($"Collided with: {other.name}");
}OnParticleCollision is a Unity event method triggered automatically when particles collide with other GameObjects.
The method OnParticleCollision(GameObject other) is called by Unity when particles from the Particle System collide with another GameObject. The parameter other is the GameObject collided with, so the Debug.Log prints its name.
In Unity, to detect particle collisions and trigger the OnParticleCollision method, which setting must be enabled on the Particle System?
Look for the module that controls particle interactions with other objects.
The 'Collision' module must be enabled and 'Send Collision Messages' checked to allow the Particle System to send collision events that call OnParticleCollision.
Examine the following code attached to a GameObject with a Particle System. Despite particles colliding with other objects, nothing is printed in the console. What is the most likely cause?
void OnParticleCollision() {
Debug.Log("Particle collided");
}Check the method signature required by Unity for particle collision callbacks.
Unity requires the OnParticleCollision method to have a GameObject parameter to be called properly. Without it, the method is not recognized as a collision callback.
You want to count how many particles collided with other objects. Which code correctly increments a collision count each time a particle collides?
int collisionCount = 0; // Your OnParticleCollision method here
Check the required method signature and parameter types for OnParticleCollision.
The correct signature is void OnParticleCollision(GameObject other). Option A uses this and increments the count correctly. Option A lacks the parameter, C misuses the parameter, and D uses wrong parameter type.
You want to detect each individual particle that collided and get its position during the collision event. Which approach correctly achieves this in Unity?
Look for a ParticleSystem method that provides detailed collision event info.
The method GetCollisionEvents returns a list of ParticleCollisionEvent objects, each containing info about individual particle collisions, including the collision point.