I need help working out with the crouch animation and the run animation colliding with each other, I am using external events
When my player holds crouch when running, he should then go into crouchwalking
But instead, the player’s animations start flickering between the run animation and the crouch animation
(both of crouch walk state and run state’s code)
i can’t tell for sure from your captures. what are the conditions for changing to run or crouch? i can’t tell what conditions change those states. It would seem like the one for crouchwalk is somehow shares the condition for running if it bounces between them.
It’s undeterminable from the screen shots what the conditions are that set the animation.
However, what you describe generally happens because the animation is changed elsewhere or multiple times in each run of the event sheet.
The “Change animation” action won’t restart at frame 0 if the animation doesn’t change from what it was before the change animation action. It only resets to frame 0 if the animation has changed from one to another.
So, for example, if the animation is “walking” and it is changed to walking, then animation keeps playing smoothly, continuing from the frame it is at.
But if the animation is set to “idle” (say in a unconditional event) and then set to “walking”, then both animation changes will start at frame 0.
Those screen shots still don’t give any clues to why. The first event of each screen shot changes the animation, one with a trigger once condition. That’s all we can tell.
But what the conditions are that cause these animation changes to take place is omitted. And what the various State values do is also missing.
Are the 2 screen snips with the animation change actions the only ones in your project? Or are there others?
I don’t see any events that change the State to 5.
BTW, it may make it more readable and easier to understand what’s going on if you use strings as the state, and not numbers.
Also, if multiple conditions need to be met for the action to be processed, then there’s no need for the “If all of these conditions are true” to be part of the condition:
Just have all the conditions in the one event, and they all will need to be met for the actions to be done
Can you please give a screen shot around that event for context?
Also, look at the conditions that need to be met for the crouch state to change to run state. Are they the same as the state change from run to crouch? Or does one set of those conditions contain all the other state’s conditions?
There’ll be condition that are the same that will be triggering the change state. Find it and alter it so the condtiions are unique to each state.
Wait… I just realized that condition wasn’t there in the first place in crouch_walk! Now I re-added it and it works now! One frame of the run animation still appears when I press the run button while crouch walking though… Jesus, I should pay more attention
First check that there are no changes to the State variable outside each state’s events.
Then make sure only the following state changes are possible:
In the crouch events, you should only be changing to idle state (if down key is released) or crouch walk state (if left or right keys are pressed or player is moving). There should be no change to running in the crouch state.
In the crouchwalk state, there should only be state changes to running (if down key released), crouch (if left or right aren’t pressed, or player isn’t moving) or jump.
In the idle state, it should only change to run, crouch or jump.
Run state should only change to idle, crouchwalk or jump.