Change animation for the rest of the level after collision

So I am trying to make a game and in the beginning I want the character to pick up an axe then the sprite model be holding it. I have Idle and walking animations for left and right for the sprite with the axe and a separate for the animations for the walking and idle without the axe. I am trying to make it so that when The Sprite collides with the axe then the axe will delete then some dialogue will popup then the animations for idle and walking will change from without the axe to with it, this is hard to explain so I will include screenshots for sure. Right now what happens is the sprite collides with the axe then it deletes and the player can’t move (which I want to happen) then the Idle sprite changes from no axe to axe some text appears then after a few seconds the player can move again and the text disappears but the walking animation shows the first frame only for walking with the axe. I tried a lot of things but I can’t figure out how to make the full walk animation play. Also, the player shouldn’t be able to put in the key inputs to turn the sprite while the dialogue is showing but that isn’t as big of a deal. I hope this wasn’t too confusing to follow. It only allows new users to put one picture so I will put more in comments if need be.

Here are the sprites that should play after colliding with the axe.
Screenshot 2022-12-16 9.28.58 PM

Screenshot 2022-12-16 9.29.19 PM

Screenshot 2022-12-16 9.29.22 PM

Here are the sprites for before the collision
Screenshot 2022-12-16 9.28.54 PM

Screenshot 2022-12-16 9.29.13 PM

Screenshot 2022-12-16 9.29.16 PM

When I walk after the collision this is the only frame that plays, but when the player releases the key the idle animation plays as it should and the going left animation freezes on the first frame too.
Screenshot 2022-12-16 9.37.34 PM

On your first set of key press conditions, try putting a condition instead of having them set to go always with no conditions. Try putting them as sub events to a condition like “text of new text does not equal if he left it I’ll find him” etc.
Because I think the key release post collision events are executing normally because you do not have conditionless pre collision key release events.

I think I did what you suggested but it still plays just the first frame.

You have to put trigger once to not change animation infinitely. If you don’t put trigger once last code works always and cancel out the earlier ones :slight_smile: If you want to change animation always use trigger once, hope this helps. :slight_smile:

Action 1 gets run, sets animation to 4.
Then action 2 is run, resetting the animation to 6 and the first frame.
Then action 1 is run again and resets the animation to 4
Then action 2 is run again, resetting the animation to 6 and the first frame.

This loops over and over again, so your animation never gets out of the first frame of animation 6.

I can see that now, thank you! Do you have any suggestions on how to fix it?

Where am I putting the trigger once, when I put in on the sub-events it still only plays the first frame after collision with the axe, and when I put it under the when the text does not equal it didn’t play the first frame of the walking without axe animation. Could you elaborate, please?

The best method would be to put the animation value into a variable by setting the variable value in actions where you currently set the animation. Then set the animation to the variable in one single separate action. That will cover the animation for all conditions and all directions.

Im sorry, im new to this stuff and I’m a beginner, could you walk me through this? if you don’t want to spend the time I understand, ill figure it out eventually. Thank you though, you’ve been helpful.

Something like:

(but you’ll need to change Player to MCNothing)

The way "Change animation number..." works is that if the animation is set to the same number as it is currently, nothing happens; the animation continues playing as normal. When the animation number changes, the frame is reset to the first one of the new animation.