Trying to pause input briefly after wall jumping using a state machine

Godot Version

4.7

Question

Hello! I’m working on a little 2d platforming project and I decided to try using a state machine for my character movement. I’ve implemented wall jumping, and while the wall jumping itself works, I’m trying to make it look a little better. Specifically when the player jumps off a wall they turn the other direction, but then they can turn back around and keep wall jumping, like in Hollow Knight. When doing this though the player sprite quickly shifts between facing left then right, or vice versa. I’d like to pause any player input for a few milliseconds in order to make this look less jarring, but I’m not sure how to do that with a state machine. If I had written all the player code in one file I could just make a boolean that checks whether the player is wall jumping and use a timer to stop all input until that boolean equals false, but I’m not sure how to do that with all the states in different files.

Any help would be greatly appreciated!

Why not? If every states know where the flag variable is stored, they can all access it. You just need to store it somewhere.