[RESOLVED] Issues with CollisionHandlerPusher

Hello everyone,

So I have an Actor and a wall. The actor is controlled by the keyboard, similar to Roaming Ralph. For basic collision handling, I used a CollisionHandlerQueue. When a collision happened, the Actor freezes in place.

I changed it to CollisionHandlerPusher so I could have the actor react to the wall a bit better. Here is my code:

    def __setupCollisionHandling(self, collisionTraverser):
        fromObject = self.attachNewNode(CollisionNode('ralphSphere'))
        fromObject.node().addSolid(CollisionSphere(0, 0, 2.5, 2.6))
        fromObject.node().setFromCollideMask(self.collisionMask)
        fromObject.node().setIntoCollideMask(BitMask32.allOff())
        
        pusher = CollisionHandlerPusher()
        pusher.addCollider(fromObject, self)
        collisionTraverser.addCollider(fromObject, pusher)

When I hit the wall at an angle, it works exactly as expected. But when I hit the wall head on, I go straight through. Any ideas?

Thanks in advance.

How fast are you moving? Fast enough to pass completely through the wall in one frame? Have you tried enabling the setRespectPrevTransform function, as described in the manual for fast collisions?

David

It doesn’t seem to happen in one frame. It’s as if the wall is not there when I’m 90 degrees running into it. I can walk in and out of a pretty thick wall in multiple frames.

Actually, that did it. Thanks for your help!