Character walking backwards when colliding in the X axis?
Ok, so this isn't a serious issue that I must fix in order to progress making my game like all the other stuff I've asked before, but it's something I think is worth pointing out.
I'll give an example:
There's an active on the right of the screen that's meant to stop the player object from moving when colliding. I walk the character to the left and collides and stops while the sprite is looking to the right, all good.
But when I walk in the opposite directon (left), the character continues to look to the right, so it's basically moonwalking, and the animation doesn't play on reverse so it's not like you can pretend it's intended.
After a while of constantly going left-right (or just up or down which will stop the issue instantly) the animation fixes itself.
This happens also if the obstacle is to the left, which means this only happens in the X axis, and not in the Y axis (up-down), there it works as intended.
I tried to replicate the issue in a new application but there the issue isn't happening, so it must be an issue with my code.
I haven't programmed anything that tells the character to look to the obstacle when colliding, much less only in the X axis, so there must be something hidded that's causing this behaviour. What could it be?