by bArray · 8y ago · 0 comments
If there's a collision in either X or Z, both should be rolled back to their last positions. I think there is possibly an edge case hidden in there otherwise.
P.S. Nice code by the way.
Rolling back X and Z when any collision occurs would prevent you from "hugging" (i.e. sliding along) walls. The problem was that a near corner collision wasn't correctly detected when the player didn't collide in X direction in the last frame (last_x) but does collide in the current frame (t.x), allowing the player to move into the corner in Y direction.
Thanks!
Same here.