Attack animation won't play while running?

0 favourites
  • 3 posts
From the Asset Store
A set of board games to make your day joyful. Play, Enjoy, Relax
  • Hello, I'm new to Construct 2 and have encountered a problem with my platformer. I have the shift key set to make the player do a sword attack animation, which does not work while the running animation is playing. Is there a way to set the attack animation to be priority over the running animation? If this provides any more clarity, the running animation is only triggered if the player is on the ground and moving. If you have a solution I would greatly appreciate it!

    -Sseverus

  • Typically events that happen lower on your event sheet within a multi-part statement take priority, so try placing your attack event above your running event. It could be that your game is triggering the attack, and then right away triggering the run, making it like the first event never happened. Try reordering the events.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You also have to look at your logic, you logic most likely says if the player presses right, play the run animation. YOu need another sub condition that check if they are hitting left/right and hitting attack to handle that scenario correctly. You need to think about what actions your character could have happen at the same time, then either create conditions that match those to play the correct animation or use event to keep certain conditions from happening at the same time. Using variables to track state can help this a lot. You can have a variable for running, and one for attacking. In your attacking check you look to see if the character is running and if so, cancel the run, or do whatever you need in that situation.

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