Hello
i’m Working on a 2D Platformer and i am struggeling with the hit animation.
I want the Player to get knocked back and play the Hit animation, if he collides with the enemy (Bat)
The Knockbackpart works fine but, it’s either not playing the animation or getting stuck on the last frame.
I’m pretty shure in code 1 where its not playing the hit animation the other animations (Run, Idle, Fall) get triggert because the conditions get fulfillt.
If I trie to adjust the conditions like in code 2 it gets stuck on the last frame of the hit animation and won’t change back to any other animation.
I think to make your knockback work you need to make some small changes to various events.
Change the force to “permanent” here, because your event will only happen on one frame and you need the force being applied more frames to move your character:
I believe that with these changes your knockback will work as long as your Hit animation is playing. Then choose the timing of your “Hit” animation according to your preference.
Thank you a lott !!
The knockback works way better now. The hit animation wasn’t set to loop, but the rest of the changes made it way easier to figure out a solution for the Hit animation i just made it that at the end, the animation changes to jump so it wont be stuck on the last frame of the hit animation.
(my eventsheet now)