Collision Detection problem

Yeah, still working on that pinball idea. Here’s my new problem, and I thought I had a solution for it, but no.


I built an extra collider onto the flipper so the flipper wouldn’t pass right through the ball when it flipped up. Or so I thought. The grey circle is the ball. The big grey thing hanging under the flipper like a huge plastic jowl is the collider that the ball absolutely shouldn’t be passing through.

The ball does respond to the collider, but only when the flipper is standing still or moving so slowly that it can’t possibly propel the ball anywhere.

Here’s the hierarchy:

(FYI, Flipper Collider 2 is the same thing for the other side, without a renderer so it doesn’t show up and without any sort of collider so it doesn’t interact with anything.)

Can someone tell me what I’m doing wrong, please? Do I need more polygons on that mesh? Should it be shaped differently?

Most likely, on one frame the flipper is on one side of the ball, and the next frame it’s on the other side. There’s not much of a cut-and-dried solution to this problem. You can decrease the Fixed Timestep (in Time Settings) and it will be more likely to collide, but that will probably make your game chug.

In the case of pinball, you might be able to get away a differently shaped collider while it’s moving (make the shape look like the entire “swoop” of the flipper); though you should definitely not keep that shape when it’s not moving. That way the physics engine should be able to detect the collision and bounce the ball appropriately.

The third solution would be to not rely on the physics at all for this and custom-code the modification to the ball’s velocity (which, I suspect, most pinball video games do.)