This project has moved and is read-only. For the latest updates, please go here.

Collision Box Grabs Edge

Jun 11, 2011 at 7:41 AM


Sometimes a collision box (a rectangle) gets caught by another collision box even if it is not top of it.



Is this a bug? or am I doing something wrong?


Jun 15, 2011 at 6:51 AM

I wouldn't call it a bug per se, but it is inconvenient. I've run into the same problems with my game. You could work around the problem my making that left wall a single body.

Increasing the simulator sensitivity or adding contact points will help alleviate the problem, but I don't think it is going away.

Jun 16, 2011 at 10:42 AM

I ran on the same problem (my game has a similar "wall slide"), what I did to solve that was to first do an AABB query around the character, if it detects the character is about to hit against a vertical wall, set its linear velocity's X value to zero and then add a prismatic joint to create the wall sliding effect. This way the main character's geometry never really hits the wall when creating the joint and doesn't get stuck. Hope it helps.

Jun 17, 2011 at 8:29 PM

@Pnikosis Would you mind posting a code sample for that fix you made? I would like to see how you create the joint and do the AABB query. Maybe it could work for my problem too. Thanks!

Jun 20, 2011 at 4:45 PM

I'll clean up the code a little and post it here, hopefully tomorrow :)