Taking damage from particles

I have added the mechanic of the enemy shooting at the player once I am within a certain range from them. Everything works great except… I can’t get my player to recognize that it is taking damage from a particle system when hit by the enemy rounds. I have a triggered box collider and a kinematic rigid body on the player and have attempted to use just a non triggered box collider on the enemy so that it recognizes when the player hits it with a particle , as well as tried adding a kinematic rigid body to it but I still don’t get any messages when I add collision message sending to the particle system. Any ideas? I read on unity’s site that I might need to add a script to the particle system but that sounds like i might have misread something. Any ideas would be greatly appreciated :slight_smile:

I think i figured it out, but i seems odd to me. I added a non triggered box collider to my player and it now senses when it is hit by enemy particles. However now I have a triggered and non triggered box collider on my player prefab, does that even make sense?

Hi David,

For what do you need two colliders (one trigger, one non-trigger)? This could make sense if they don’t share the same position. It depends on the context, though.

In order to still be able to have the enemy recognize being hit by particles from the player particle system I had to have a kinematic rigid body and triggered box collider on the player and a non triggered box collider on the enemy.

I also want the player to be damaged by the enemy particle system particles and nothing i did other than adding a non triggered box collider to the player prefab and a kinematic rigid body to the enemy worked. Is there another way around this?

That sounds as if you don’t need two colliders on the same game object. Take a look at the table at the bottom of this webpage.

Also from the manual:

The Rigidbody component has a property called Is Kinematic which removes it from the control of the physics engine and allow it to be moved kinematically from a script.

Does your enemy have got a Rigidbody attached? If not, attach that component. The Rigidbody on the enemy does not have anything to do with the particles, though.

This topic was automatically closed after 6 days. New replies are no longer allowed.

Privacy & Terms