Inconsistant Collision Detection

Hello,

I have an enemy in a room that shoots projectiles at the player. When the projectile hits the player it seems to always detect the event and explode. However when the projectile hits the room (floor, walls) only some of the time does the projectile collide and explode. It seems at least half of the time it goes passes through the obstacles.

I checked my collision mesh for the room and it seems fine, I’ve tried two (using the visible mesh as the collider and building a low-poly one for it).

The player that contains a rigidbody component reacts with the room consistantly nearly 100% of the time . It’s only the projectiles that don’t. I event built a custom collision mesh for the room with extra thick walls and floor to make sure that a thin floor and walls weren’t the problem. I’ve checked my rigidbodies and colliders on my objects as well and everything looks ok to me.

How can I make the projectiles have consistent collision detection with everything else?

This is the classic ‘bullet through paper’ problem, and happens because the bullet is smaller than the distance it covers in a single physics step. It never collides, because it never intersects with the wall!

You need to use some kind of raycasting arrangement, to check for collisions between the previous location an the current location every physics step, and then adjust the projectile’s behaviour if it picks up collisions that the physics engine does not.