How do I make Sleep animation

0 favourites
  • 4 posts
From the Asset Store
4 Block Soldiers with different animations, 400x400
  • Hi i need to know how make sleep animation when me character wait to long on one place sound simple but i dont know how to do this really thank u for help!

  • probably lots of ways. One way I could think of is to have an idle timer set in a variable which activates when the character stops moving and increases by 1 every second, then compare that in an event. If it reaches a certain number (thinking in seconds and however long you want it to wait), then set animation to the sleeping loop.

    when the character moves, that variable just needs to be set back to zero.

  • Like LukeW said... Make an event simply adds 1 to a "idletime" variable every second. Have another event that conditions to idletime>=(time in sec you want) then action out to whatever animation you want.

    In your movement events simply add a set idletime=0 after each use.

    What will happen is the first event will always try to count idletime up while any movement will always reset it to 0. The second condition will be constantly testing if idletime is greater or equal to your sleep time you decided. As soon as it does that event will trigger whatever sleep junk/animations you action out from the event.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Ok thanks!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)