My attack animatipn plays the first frame only what is the problem[solved]

im trying to make my charcter play an attack animation

What is the expected result

Full animation to be played

Explain what should happen when you run the game.
the character should be able to attack completey

What is the actual result

character is stuck on first frame

this is the idle animation but i cant get the attack animation since it wouldn’t let me take a screenshot

this is the frame it is stuck on

Hi, did you search the forum a bit? Animations being stuck at the first frame are often a sign for a conflict in the events. Here is a suggestion of how to trace possible conflicts in your animations: Animation is stuck on first frame, how to fix that?

“Change the animation” also restarts the animation at frame 0. So for example you have “when player is falling, change animation to falling”. This means every gametic where the player is falling, this will trigger and restart the animation.

You would need some other condition like “trigger once”. Or, you could check if the animation isn’t already changed:

player is falling                 |  change animation to falling
animation is not equal to falling |

i did what you said and added a trigger once but also is player is on floor, player is not moving and player is not jumping but now it is either playing the animation too fast

i cant do it since im on mac and it wont let me use inspector

Could it be something with the collision because I know that different collison mask causes different result. The platformcharacteranimator somehow make my animations work fine but doing mine doesnt work

Only if the animation is different. If, for example, animation is “Idle” and you change animation to “Idle”, the current frame doesn’t reset.

1 Like

Your issue is in the last 2 events (BTW, remove the 3rd to last event - it repeats the one following it).

When the “J” key is pressed and the player is on the floor , the animation is changed to “ATTACKS”

In the next game frame, the event prior to that is actioned, because the player is on the floor and not moving, and so the animation is set to “Idle”.

However, the very next event (where the “J” key is pressed), the animation is changed to “ATTACKS”. And because the animation changes from one to another, the frame resets to the first one.

One way to fix this is to add a “Animation is not ‘ATTACKS’” to the second to last event:

Huh, I didn’t know that. Now it makes so much sense why this happens to me when I change to a default animation before conditions >.<

Thank you it’s working now

also one more question sorry to bother if your busy but im trying to make a combo system so do you know how to make it where after attack is done if J key is pressed again it changes to the 2nd attack animation

One possible way is to add a series of subevents to your last one. The condition of each event is to check the name of the current animation, and set the animation to the next attack animation. Do it in reverse order (last attack to first attack), otherwise each event will trigger the next and you’ll end up at the last attack animation straight away.

Something like:

Note, this will only work if the attack animations all start with “ATTACK”.

It works but i have to spam the j key instead of it just being pressed once, play first animation, pressed twice and play second animation, also because i have to spam some of the time my third animation wont be seen unless i really spam j key alot and even then it doesnt work all the time