Particle Collision with Player

Hi guys,

I need some help here

I'm getting trouble with particles collision.

How may i detect particle collision with my player?

I'm using this script but its not working

function OnParticleCollision(hit : GameObject){

if(hit.gameObject.FindWithTag=="Player"){
    Debug.Log("Some Message");  
}

}

Thanks guys!!

1 Answer

1

actually, instead of that, all you have to do is on your particle System, add the world particle collider if you havn't already, check the "send collision message" if havn't already, and put this code in your player script. i learned that's the best way to detect a hit from a particle collider.

script to add to your player control:

function OnParticleCollision()
{
 //add any other code here
 Debug.Log("My Player's been hit by particles.");
}