High Velocity Collisions?

Hey all,

I noticed a strange occurance in my game today, as I was playtesting, I noticed that my bullets were going right through the wing colliders of my ships. I’m using a series of smaller colliders nested in the object, and a single simple collider on the bullets themselves. After a bit of fudging around, I noticed that the bullets never went through if I dropped their velocity to something very slow. However, at the stock velocity of 400, they sometimes pass right through and sometimes hit.
Does anyone know anything about this kind of problem, or how to help fix it? Am I doing something wrong? Thanks in advance guys.

The colliders have to intersect for a collision to register. With high velocity, the collider for the bullet is likely to be above the wing one frame, and then below it the next. It doesn’t touch the wing so a collision doesn’t occur.

The solution is to not use the physics engine for high-velocity collisions. Probably best to use raycasting instead.

–Eric

Ah, that makes sense. Thanks.

You can also change the timestep (not sure if I have the term right here) factor, this usually stops my objects from going through walls, but your velocity might be such that a raycast would be the better solution.

That’s often a bad idea, especially if you have any scripts the use FixedUpdate. It will slow the game down quite a bit.