Stop animation from pausing after switching from another animation?

Hey there. I have a slide action going on with gamepad controls. I’m having an issue making the “Run” animation continue after the slide animation occurs. It switches to “Run” and still moves but the animation is paused until I push a button. I want to have the character be moving, switch to slide animation, and then continue to run animation after the full completion of the slide animation. It’s probably an easy fix, but my mind is melted at the moment. Any suggestions?

Firstly, you don’t need the If all these conditions are true condition. GDevelop requires all conditions of an event to be true before it processes the actions.

I’m going to assume the Run animation is what’s stuck. I’m not sure how the gamepad keeps track of it’s button released, and if it clears the flag after a game frame or keep it as true until the button is pressed.

Either way, the first thing I’d try a trigger once on that last event in your screen shot, just in case.

I’d also add a condition to the last event that checks that the animation name is “Slide”.

1 Like

Thank you for the quick response and insight!

Yeah, “Run” is stuck on the first frame it looks like, so I have to press jump or repress the RT button to get it to reset. Not sure how to go about doing that particular function. I’m still very much learning. As you can probably guess, I’ve pieced this together from several random tutorials and messed around with what I thought made sense. So far it’s been pretty cool, but there’s just a few things like this I’m trying to suss out.

Here’s the updated code, I can export the test level if you want to see first hand:

This strongly points to two events being actioned, each that change the sprite to a differing animation.

Unless you can spot it yourself, the method I use to determine where the problem is in cases like this is to put a different console log message after each animation change action. This can be a bit cumbersome, but it very quickly identifies where the issue is.

1 Like

Thank you very much, I will check it out more thoroughly and see what’s going on. I appreciate the advice!

I went back over all the code, but there’s not much to go through lol. Any ideas?


Put a console log message as the first action where animation is set to “Run” to see if that’s where the issue is.

1 Like

Hmmmm…I have no idea how to set that up correctly. I messed with the debugger and didn’t see anything glaring, but I don’t really know what I’m looking for…

Use something along these lines:

image


Turn on debugger console:

image


and move the output window along the side of the editor. Turn off details and internal (at the bottom left of the console window), so the symbols look like:

image


Shift your game window across so you can see the output. Play the game, and when you slide, watch the console output. You can also pause the game in the debugger window (the play button in the top left changes to pause), at which point you can scroll through the output. The most recent output will be at the top of the console window. Check this for any other animation name, which should be in between the lines “Animation is now Run”.

1 Like

Thanks again!

One more question for ya:

I have a 20ish frame jump animation. I want the animation to play until frame 16 and then simulate a jump. What would the correct format of the conditions/actions be for that? I have some really nice animations that I want to show off, I just need it to actually do what I want lol.

Check the animation name and the animation frame number:

image

1 Like

Hey thank you! I ended up figuring it out:

Create boolean variable for jump set to false at beginning of scene.

Conditions: Jump button press

Actions: Change animation to jump animation.
Set boolean value of jump variable to true.

Conditions:
Jump variable = true
Animation is jump animation
Animation frame is = # (whatever frame number is right before the character leaves the ground)
Trigger Once

Actions:
Pause animation of player.
Simulate jump key press.
Resume animation of player.
Set boolean value = false

I had to adjust the frame rate of the jump animation to match the speed of the button press. I was still able to get 11 frames of animation in before the literal jump occurred. Worked great.

I greatly appreciate your advice! Thanks again.

1 Like