When I tried to do crouching and crawling, holding down and left/right arrow key, The crawling animation won’t play.
Down arrow > Crouch
Left/Right Arrow > Crawling
These 2 animations will conflict.
How do i fix Crawling animation?
I did this events:
There are a few ways to fix it, with my preference being the first one:
You could use a finite state machine to determine what state the player is in (in this case crouching or crawling). If in crouch mode and the left of right arrow keys are pressed, then change the state to crawling. And likewise, if the state is crawling and neither left nor right arrow keys are pressed, then change state to crouch.
You could use a variable to store the name of the animation to play setting it to the animation name that you currently have in all the change animation actions. Then in an event at the very end of the event sheet do you set the animation using this variable. This event will be the only one to set the animation by name; all the other events only set the variable to the animation name.