# How do I avoid 3D AABB collision response getting stuck at block edges?

I want the player to be able to slide along cubes, but without getting caught at the seam between 2 adjacent cubes. I've gotten it so that I can do x collision, with sliding, and y, and z, but I can't do them together, probably because I don't know how to resolve it correctly.

Here's an example:

[]
[]
[]
[]O
[]


Pretend all the tiles are touching. O is the player (moving upward). The methods I was trying would get the player stuck between the cubes because the z axis was responding and kicking me out.

I don't know how to resolve this in all 3 directions, like how would I go about telling which direction I have to resolve in. My previous methods involved me checking 4 points in a axis aligned square around the player, I was checking if these points where inside the cubes and if they where fixing my position, but I couldn't get it working correctly.

• A screenshot would be nice. – ashes999 Apr 1 '12 at 16:58
• You should merge your collision meshes to one big mesh as much as you can. This solves problems like you're having and makes detecting collisions cheaper. However there is probably also a solution without merging collision meshes so I wont post this answers. – Roy T. Apr 1 '12 at 17:09
• will your absolute collisions be axis-aligned, or will they be oriented? – gardian06 Apr 1 '12 at 19:48
• – Anko Dec 30 '14 at 1:40