SOLVED Platformer Character Stuck on Floor in certain circumstances

I am having this weird issue with the character for my platformer:
On boot, character is able to move UNTIL I let go of the arrow keys, which afterwards results in the character being stuck on the ground. The only way to get it to move again is to jump. When I jump, I can move mid air, as well as on the ground right after. Just like when starting the game, I can move until I let go of the arrow keys which results in me being stuck again. The weird thing is, when I jump, if I stay still on the ground when I land and don't move left or right, I can still move after a while of waiting until I let go of the arrows again.

I looked everywhere for an answer to this but I can't find anything and since this is a game for my friend's birthday, my deadline for this game is getting closer, so any help would be greatly appreciated. If you need any extra information, please let me know.

EDIT: I decided to start removing code one by one from my character and found out the source of the problem is the animation code. I still don't know why though, so here it is:

GML:
if (!place_meeting(x, y+1, O_Ship0)) {
    sprite_index = S_Character_idle_right
}
else {

    if (hsp == 0) {sprite_index = S_Character_idle_right}
    else {sprite_index = S_Character_walk_right}

}

if (hsp != 0) image_xscale = sign(hsp);
("O_Ship0" is my wall object)
 
Last edited:
Make sure your various different sprite's you are referencing all have the same collision mask. If the sprites have different collision masks, the object can switch from it's collisions being freely movable to being colliding with the wall.
 
Top