Rox
Rox

Reputation: 2917

Why does not my particle system collision work?

I have added a particle system where I have checked the collider option and added a world particle collider. See the image below.

In the script that is attached to the particle system I have:

void OnParticleCollision(GameObject other) {
    Debug.Log("Particle was hit!");
}

The bullets that are fired don´t seem to hit the particles since the above message is not printed. The bullets are spheres with a sphere collider and a rigidbody attached. The rigidbody is set to non-kinematic (the checkbox is not checked) if that matters.

Also, the bullet object has a script attached with the same lines as above:

void OnParticleCollision(GameObject other) {
    Debug.Log("Bullet was hit!");
}

But it is not printed as well.

What am I missing?

enter image description here

Upvotes: 4

Views: 12565

Answers (3)

dogankrnz
dogankrnz

Reputation: 1

make sure that Send Collision Messages option is checked under the Collision tab.

Upvotes: 0

thnewlands
thnewlands

Reputation: 33

Double check that you have this script attached to your particle system and not any arbitrary gameobject.

Upvotes: 2

Serhii Hubankov
Serhii Hubankov

Reputation: 46

Check if you have "Is trigger" disabled on Sphere Collider, or you're particles too small and don't hit the actual collider. Tried to simulate your situation, all works fine.

Upvotes: 1

Related Questions