Character Collisions With Doors

Guys,

I’m having some serious collision issues with my game. I have a building mesh that includes a simple collision mesh that covers all the walls. That collision mesh is working fine.

I went in and added door collision meshes as well - my doors are animated and I’ve also animated the collision meshes for the doors. For now I’m just testing the doors when they’re closed, and these collisions are hardly doing anything.

I can go up to the door collision mesh, hold down the walk key, and after a second or two I go right through.

Are there any suggestions out there for creating an effective collision system? I’m using panda’s push handler.

Each door’s collision mesh is a box and I’ve made them wider than the walls to make sure they weren’t too thin (I figure if the walls handle collisions fine, then something wider than them should be safe).

Any help getting these collisions working will be appreciated.

Thanks.

Matt

There are, of course, many different things that can cause the symptom you describe, so I’m only taking a shot in the dark here. But my first guess is that your “box” is too thin, and the back side of the door is grabbing your player and pulling it all the way through the door.

(Though you say the doors are wider than the walls. Do you also have back-to-back polygons on the walls? These normally wouldn’t be reliable either, but perhaps you are getting lucky because the walls aren’t under any transforms, which makes the math a bit more reliable.)

The most reliable way to resolve this is to not have back-to-back collision polygons if possible. For instance, if you know which side of the door your character is on now, you can stash the polygon on the back side of the door, so it won’t cause conflicts.

But if that’s difficult or impossible, a close second reliable solution is to enable ctrav.setRespectPrevTransform(), as described in the manual under “rapidly-moving transforms”. This requires you to use setFluidPos() instead of setPos() to move your player around.

David

Thanks a lot. The rapidly-moving objects section was all it took - now all collisions work very well.