OnParticleCollision - Problem

Hello,

I have a flame thrower that sends a damage to the enemy by using this:

var damage : float;

function OnParticleCollision (other : GameObject) {
    other.SendMessageUpwards("ApplyDamage", damage, SendMessageOptions.DontRequireReceiver);
}

This is attached to particle system (the flames). But nothing happens, the damage does not send and the problem isn’t to do with my enemy because I use the same methord for a machine gun and it works fine.

I have a world particle collider on too, but I haven’t ticked ‘Send Collision Message’ because then my enemy just die straight away (because there are so many particles).

What am I doing wrong?

Thanks

By unticking Send Collision Message you are effectively disabling the particle collisions.

To stop the enemy dying straight away you could use a smaller damage value (or do damage/1000 when you pass it as a parameter). You could also use a timer which only applies the damage once per second.