So on my particle system I have the collider parameter enabled so I can register when the particles collide with other gameobjects. I have a script on the particle system so it can log:
private void OnCollisionEnter(Collision other)
{
Debug.Log("on collision enter particle system with " + other.gameObject.name);
}
private void OnParticleCollision(GameObject other)
{
Debug.Log("on particle collision with " + other.name);
}
Then I also have this cube which I put in the line of fire of the particles and hoping to get a callback when collisions with the particles occur. Note it is a trigger collider. I attached another script to this to log any collisions:
private void OnCollisionEnter(Collision other)
{
Debug.Log("collision on cube with " + other.gameObject);
}
Now if I have the above setup I don’t get any logs whatsoever that any collisions have occurred.
If I change the cube’s box collider to NOT be a trigger then I get collisions registered from the OnParticleCollision method, and the particles bounce off the cube.
The cube’s box collider needs to be a trigger though since I want the particles to go through it and the cube has other interactions in the game that need it to be a trigger. So are there any ways to register when it collides with one of the particles in this state?
I have tried adding a rigidbody component to the cube as well as the particle system, but neither of those things helped and it still would not register a collision.
Any advice much appreciated.