Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | chris33556 |
The question says it all. i have a player with walking movement and a punch action move. in beat-em up games the when the player requires to punch , the sprite just stops walking and executes the code to attack.
However, in my script i cant punch until i actually stop walking first. can someone advise me on the my script how to do the reverse.i.e the movement stops on pressing the action button . here is the script:
thankyou
You need to read or watch tutorials about state machines. Otherwise, even if You fix this one, You will encounter massive amount of other problems like this. For example You will notice, that your punch cancels your kick, or that your walking freezes when input is held still.
Inces | 2022-08-17 16:21
I have been having these problems yeah . I’ve had to try 2 different ways to implement a movement and action system and it’s been a pain but I’m still learning everyday. I’ll look into state machines. thanks for the suggestion
chris33556 | 2022-08-17 16:57