Restart Run Animation After Attack Animation

Get help using Construct 2

Post » Wed Jan 16, 2013 2:05 pm

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: http://www.mediafire.com/?pgnvc9robu1u4gd

Thanks
B
3
Posts: 8
Reputation: 316

Post » Wed Jan 16, 2013 3:54 pm

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.

B
50
S
21
G
8
Posts: 844
Reputation: 10,299

Post » Wed Jan 16, 2013 4:50 pm

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...
Image Image Image
B
60
S
19
G
5
Posts: 325
Reputation: 7,369

Post » Thu Jan 17, 2013 9:12 am

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!
B
3
Posts: 8
Reputation: 316

Post » Thu Jan 17, 2013 11:09 am

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!
B
3
Posts: 8
Reputation: 316


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 3 guests