How do I stop animations getting stuck?

Get help using Construct 2

Post » Wed Jan 17, 2018 11:40 am

My character sprite has animations for idle, jump, falling and running.

If you switch between these too quickly, they get stuck.

So if I'm running left, and then I quickly run right, it will get stuck in Idle animation.

Any ideas why this would happen?
B
4
Posts: 20
Reputation: 240

Post » Wed Jan 17, 2018 11:43 am

Impossible to tell without seeing your project.
Please share the capx or at least a screenshot of your event sheet.
B
17
S
9
G
128
Posts: 1,777
Reputation: 68,377

Post » Wed Jan 17, 2018 11:47 am

Image
B
4
Posts: 20
Reputation: 240

Post » Wed Jan 17, 2018 11:52 am

Don't use "On key released" event to set Idle animation, because the key can be released while another key is still down.
Use "Platform is NOT moving" event instead.
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :) If you'd like to hire me, please see this post
B
17
S
9
G
128
Posts: 1,777
Reputation: 68,377

Post » Wed Jan 17, 2018 11:58 am

Thanks for getting back to me.

Oh sorry, I used Platform on Stopped - which worked!

Thanks man!

EDIT:

The only other issue I'm still having is than when I land, after the jump and fall animation, if I'm holding right, it doesn't play any animation at all.
B
4
Posts: 20
Reputation: 240

Post » Wed Jan 17, 2018 12:20 pm

This is what it looks like now.

Image
B
4
Posts: 20
Reputation: 240

Post » Wed Jan 17, 2018 1:08 pm

What happens if you press Left or Right in mid-jump?
You need to add another condition to those events - "Platform is on floor"
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :) If you'd like to hire me, please see this post
B
17
S
9
G
128
Posts: 1,777
Reputation: 68,377

Post » Wed Jan 17, 2018 1:42 pm

If I press left or right mid-jump, the animation is interrupted by the looks of things.
B
4
Posts: 20
Reputation: 240

Post » Wed Jan 17, 2018 3:27 pm

Still not working unfortunately. The animations just stop if I'm holding right and jump at the same time.
B
4
Posts: 20
Reputation: 240

Post » Wed Jan 17, 2018 4:08 pm

You need to change animations on Platform events, not on Keyboard events.
Try something like this (screenshot from someone else's game):
Image
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :) If you'd like to hire me, please see this post
B
17
S
9
G
128
Posts: 1,777
Reputation: 68,377


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 6 guests