I am making a side scrolling platformer and I need help. the player has a bunch of animations including idle, run, fall, jump and attack. All other animations play properly when the condition is met, except the attack animation. I want the attack animation to play when i press the “p” key. I made the event such that when the “p” key is pressed, the attack animation should play. however. when I run the game and click on the “P” key, only the first frame of the animation plays. I have been struggling with this for quite sometime now and I thought I should ask here. here are some screen shots of the events sheet.
please I need help fixing this problem. I want the whole attack( Slash) animation to play when I hit the “p” key.
Be sure you have Loop checkbox checked in your animations
Add trigger once to each condition where in action you change animation
Thanks for the suggestion but i already had the animation looping and it was still the same. i had previously added the trigger once condition but it just made the first frame play by really fast. got any more suggestions??
Also when i hold down the “P” button, the player animation is just stuck on that first frame of the attack animation. any more tips would be helpful pls
The problem is with the last 2 events. When you press ‘P’ and nothing else, the player will be on a floor/platform object and not moving. This satisfies the second to last event condition, and the animation is set to 0.
But in the next event the
'P' key pressed condition is true and so the animation is set to ‘Slash’. Because the animation has changed (from 0 to ‘Slash’), the Slash animation start afresh, giving the appearance of being stuck in the first frame.
To fix this, add a condition to the second to last event. Either check that the ‘P’ key is not pressed (invert the
'P' key is pressed condition), or check that the slash animation is not playing. Both ways should work.
ohhhh my gosh thank you i just implemented your suggestion and now it works perfectly. i am really grateful bruhh. you’re a life saver