Particle Collision

I’m trying to get my particles to either disappear or bounce off the walls in my game when they collide with them.

I have a world collider on my particles, so they do bounce off the walls when I am far enough away. However, it’s when I get close that things start screwing up.

As you can see in my picture, the particles are going through the wall. I don’t know how to fix this. I’ve tried destroying them in an oncollisionenter function, but that didn’t seem to help. I’ve also reduced the # of particles to practically nothing and that doesn’t seem to help either. What do I do? >_<

512950--18242--$Capture.PNG

First, try playing with the setting of the particle world collider. You want to make the particle loose life when it hits a wall and auto destroy it.

if that isn’t working check that the particles aren’t being spawned on the other side of the wall or in the wall.

If so then they’ll never collide with that wall.

Also, if a particle moves so fast that it doesn’t intersect the wall from one physics timesetp to the next (by default 50 updates a second) then it also won’t collide.

So, slow the particles down and make sure they don’t spawn inside or on the other side of the wall. Make the emitter ellipsoid really small, centre it on the character not the end of the weapon, adjust lifetime alpha animation to compensate.

Thanks Cameron. I was able to figure it out with your pointers. I didn’t need to mess with the loss of energy with the particles. My problem was that the flames were spawning inside the building. After changing that, I got it to work.