0 Favourites

Restart Run Animation After Attack Animation

  • Hey folks,

    We're currently working up a platformer prototype using a sprite set of Batman until our own assets are ready.

    I've a decent bit of functionality: run, jump, 3 combo attack with hit detection, jump off walls.

    I've set it up so that if the player is moving and press attack (A), the character stops running, player loses control, and the attack animation plays. After a moment the player is given back control.

    This all works alright with one exception (otherwise I wouldn't be posting!):

    If the player holds down either move key (left or right arrow) while also attacking, once the attack animation is finished the character moves but he slides (keeps his standing animation pose) instead of triggering the run animation.

    I've tried a couple of things to fix this but I can't seem to get around it! Any advice would really help.

    Here's the link to the capx file: mediafire.com

    Thanks

  • I'll take a look at the .capx when i get home, but i had a similar problem.

    How are you making the character stop moving?

    Try using the "set platform behavior disabled" instead of "stop" and see if that fixes the problem.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • I tried adding an "every tick, set animation to player at image point 0" instead of the pinning condition which helped a bit, but I think it has to do with the timed events and respective animations.. seems like the set "enable" platform is at the correct time but the animation is not being triggered at the same time. Which is causing the slide.

    Perhaps adding the key is down condition for right and left controls as a sub-event within your attacks would be the fix. Basically saying after the attack is triggered and it does all the stuff, then once it's done AND left or right key is down, then enable platform and play animations.

    If that makes sense...

  • That might be an idea. I'll give it a shot. I thin I tried something similar (hard to keep track of all the things I tried to fix it!) but I shall give it a shot.

    Cheers!

  • I managed to get it fixed.

    Using your response facecjf I got the run animation playing after the attack, but then the player wouldn't move! I needed to remove some actions from within the attack event that disabled platform control and give them their own separate event.

    Thanks for pointing me in the right direction!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)