0 Favourites

How do I change from Run animation to Idle Smoothly?

  • Hi,

    I would like to make a seamless transition between end of RUN animation and beginning of IDLE animation.

    I've already made the opposite (from IDLE > IDLE to RUN > RUN), but the other way around is more complex from what I'm thinking.

    I was thinking like if current frame from RUN is playing + then go to specific frame of TRANSITIONtoIDLE then IDLE.

    Something like that.

    Any help or .capx examples?

    Thanks!

  • One thing I've done in the past (which you may have already tried): if the RUN animation isn't too long (less than half a sec before it loops), you could wait until it reaches its beginning (transitional) frame before stopping.

    For example:

    -- If Player is Stopped & RUN is Playing & RUN animation frame is 0

    ---- Set animation to STOPPED

    The issue with this is that he'll run a little in place before he becomes truly idle. The longer your run animation, the worse it'll look. Often times, you'll have multiple identical (or similar) frames in your RUN animation. If so, you can improve the result by testing to see if it's any of these frames rather than just the first one. If your player has deceleration (i.e He gradually comes to a stop when there's no input), then this could look pretty decent if you start the transition while he's slowing down.

    A more complex approach (just throwing it out there, don't know if it'll look good) would be to locate an appropriate transitional frame, and then animate the character towards that frame. For example, if the character's walk is 10 frames long, but he is two frames past the ideal transitional frame, reverse the animation, and then stop it once he's at the right frame. If, on the other hand, he is 8 frames in, let it play out until it loops. Find the closest distance and change the animation accordingly.

    Don't know if that gives you any ideas at all :P

  • Thanks for the ideas!

    I'll see what I can do

  • 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 can have your player with 4 animations:

    -idle - looping idle animation.

    -idletorun - a couple of frames where you start to run

    -running - looping while running

    -runingtoIdle - couple of frames from running to idling

    or if you want to do it hardcore way - gradually slow down running animation, it will look like you move slower and slower, and then swap to idle. though this will require only 2 animations it will look way worse.

  • Thanks saiyadjin, I'l try that

Jump to:
Active Users
There are 2 visitors browsing this topic (0 users and 2 guests)
Similar Topics Posts Views Last Post
Unread hot topic
1,941 263,235
FlyingRam's avatar
FlyingRam
Unread hot topic Locked topic
195 16,197
Ashley's avatar
Ashley Construct Team Founder
Unread hot topic
99 10,137
karshinkoff's avatar
karshinkoff