4

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

Rox
  • 2,647
  • 15
  • 50
  • 85
  • Have you solved this problem? I'm experiencing the same using Unity 2017. – Marek M. Aug 06 '17 at 09:29
  • Sorry, I don´t remember if I ever solved it. I suggest you ask the question on the Unity discussion forums where the activity is high: http://answers.unity3d.com/questions/ – Rox Aug 15 '17 at 17:46

2 Answers2

2

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

thnewlands
  • 33
  • 6
1

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.