0 Favourites

Attack animation won't play while running?

  • 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.

  • Construct 3

    Buy Construct 3

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

    Buy 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)