Hello, I have a Particle System with Collision, here is screenshot: basically it’s just a sphere.
I have a GameObject with a CapsuleCollider which is trigger with OnTriggerEnter function:
void OnTriggerEnter (Collider other)
{
if(other.tag == "Particle") {
Debug.Log("Hit by Particle");
}
}
GameObject on which particle is attached has a tag “Particle”. The problem is that this doesn’t work. Particle collision never triggers capsule collider. I tried without a gametag, still the same. I know that I can use OnParticleCollision()
but I need to detect collision on other gameobject, not on the gameobject on which particle is attached.
Hope this can help.
In Particle settings => Collision turned on => Type set to World= > Send Collision Message checked.
With Triggers turned on.
private void OnParticleCollision(GameObject other)
{
bool special = false;
switch (other.tag)
{
case "NormalFire":
hitDamage = 1;
break;
case "SecondaryDamage":
hitDamage = 5;
break;
case "SpecialFire":
hitDamage = 10;
special = true;
break;
default:
break;
}
,Hope this helps.
With Collision on, set to World, and Send Collision Message.
With Trigger on also.
private void OnParticleCollision(GameObject other)
{
bool special = false;
switch (other.tag)
{
case "NormalFire":
hitDamage = 1;
break;
case "SecondaryDamage":
hitDamage = 50;
break;
case "SpecialFire":
hitDamage = 10;
special = true;
break;
default:
break;
}