How to smooth CollisionHandlerPusher?

Ah, yes, so that’s your problem: both the side and the bottom of the box are pushing back on your object, and so the object gets pushed twice. As long as you don’t collide right on the edge, it should be better. In your example, for instance, change your collisionBox position to:

        self.collisionBox.setPos(0, 5, -2)

This is one of those cases that the CollisionHandlerPusher tries to handle correctly, but doesn’t get right all the time. The problem is that sometimes when two walls are both pushing on an object, you want them both to apply (for instance, when you’re walking into a concave corner), and sometimes you want only one of them to apply (as in this example). It’s surprisingly difficult to get all the cases right.

The current CollisionHandlerPusher tries to compromise in favor of keeping things from getting stuck or from falling through walls, but it doesn’t always guarantee smooth behavior. Over the years, we’ve played with difficult variations on this algorithm, and this is the one that has made the most people happy most of the time.

I’m not saying it’s perfect–no doubt better algorithms are possible–but this is the one we’ve settled on so far.

David