I'm making a little platformer using the Platformer behavior for my player character. What I'm noticing is that there's no clear way to discern if something is hitting my player from a certain side.
I've been using a check of the player.X or Y with that of the colliding object so far. Combined with a check if the player is falling, jumping, etc. (conditions provided by the Platformer behavior) this method gives a good approximation of the direction of collision.
This solution is not perfect, however. If the player is falling, using this player.Y<object.X as a condition will trigger for a collision on the side as well as the top of the object. Hitting it perfectly on the side while falling, with the player.Y<object.X, doesn't happen very often but it does happen.
What I'm looking for is another method to detect which side of the player's collision box is touched by static/non-static objects. My player's collision is always a rectangular shape.
Any help is greatly appreciated.