Attack animation won't play while running?

Get help using Construct 2

Post » Sun Jun 09, 2013 4:03 am

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
B
3
Posts: 3
Reputation: 181

Post » Tue Jun 11, 2013 5:58 pm

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.
B
21
S
8
G
5
Posts: 89
Reputation: 6,017

Post » Tue Jun 11, 2013 6:50 pm

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.
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,573


Return to How do I....?

Who is online

Users browsing this forum: newt, Yahoo [Bot] and 12 guests