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!
Develop games in your browser. Powerful, performant & highly capable.
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.
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.