I have a simple problem in my game at the moment.

When there's a doorway or a vent in my game, jumping at the wall above it results in the player moving through the wall once he has landed. I want to prevent this from happening. I made the player automatically crouch if this happened, but it gets in the way of other things, and is a rather rough fix.


NOTE: This image isn't completely accurate. The open space below has to be a bit bigger. What's shown above wouldn't actually result in the player moving through the wall.

Anything I can do to prevent this?