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.