When I press "up" sprite switches to correct animation, then vanishes

When I press “up” sprite switches to correct animation, then vanishes.
I’m very confused. Brand new to GD, just been watching videos and doing tutorials for less than 2 weeks. So I assume I am doing something wrong. But can’t figure out what.

Condition: Up key is pressed
Action: Set animation of player to “Up”

Is that not the right way to switch to the animation of the character walking up in a Top Down game?
It definitely switches to the correct animation but only for a spit second before it vanishes and never comes back no matter what arrow key I press.

Thanks for any help!

Ok so it looks something like this

and it should look something like this

the thing is you are not declaring what will happen once the button is not pressed, or are you?

another issue could be that your UP animation is not set to a Loop and the last frame is empty

Oh! Thanks! I didn’t even think about giving it instructions for what to do when the button isn’t pressed.

How do you get it to have the “trigger once” part? I did a search for the condition “trigger” but it didn’t show up.

I looked around some more, and changed the slider for “share same collision mask among all animations” to yes and that fixed the vanishing problem. I am not sure why, but it was something I hadn’t tried yet. So at least the problem is solved. But I would like to add your idea for aesthetic reasons.

To find the trigger once, just type “once”, what this does, is limit the execution of the action to just once per press detect, and not while it is pressed, this will avoid problems in the future if more than one movement button is pressed at the same time

1 Like