If you think about what’s happening, step by step, your issue is that the buttons don’t care if the other of the two is pressed or not. For example, you press left and your character moves left, then you press right and all the animation code just assumes that left is no longer pressed and starts the animation for walking right, even though the left button is still held down.
Instead of adding more logic to fix this, I would recommend stripping down the logic and not using On Button Pressed/Released blocks at all. I would use a single Forever block, combined with those < Is Button Pressed > Boolean blocks from the Controller blocks tab and some IF blocks. Then, because animations look frozen if you constantly restart them, I would have a variable to keep track of which animation is playing and not restart the animation if the correct one is already playing.
That might be a lot, so here is some sudo code:
“anim_playing” is 0 if none is playing, 1 if the right animation is playing, and 2 if the left one is playing
Forever:
If ( < is Left button pressed > = < is Right button pressed > ):
If ( anim_playing ): stop animations and face a direction based on what value anim_playing is.
Else if ( < is Right button pressed > ):
If ( anim_playing =/= 1 ): anim_playing = 1, start walking right animation
Else:
If ( anim_playing =/= 2 ): anim_playing = 2, start walking left animation
P.S. You can use variables in IF blocks without “ = true” part. Just put the variable in. Use the “< Not <> >” block to check for false. Number variables will be “false” if 0, and “true” if anything else, which is how that “If ( anim_playing )” part is checking that the variable isn’t 0, because if an animation was playing the number would be “true” because the number wouldn’t be 0.
The first If statement works because if both left and right pressed are False, then they are equal and the stop animation code runs, and if they are both true, that means they equal and the stop animation code runs, which is very convenient.