Switch animation after character's been idle long enough?

From the Asset Store
Full game Construct 2 and Construct 3 to post on Google Play
  • I just started working on a new game (a platformer) a while ago. I want my character to blink eyes if the player has stood still for ten seconds. I have an animation for the blink that's based on the idle animation/still.

    However, the animation sometimes pops up even when the character is running. Sometimes the animation also happens twice in a row. Any idea how I could fix this? Here's my current code:

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I now noticed I can change the duration of a frame in an animation. I added the blink frames in the idle animations and made the original idle frame last extra long. Still, I'm wondering if this is the best way to do this.

  • I think that you should use timers for that..

    On Platform stopped -> start timer

    On timer -> Set animation to Blink

  • One way of doing it is to not make the idle animation "looping" but using instead the "repeat" option (in the animation editor properties)

    Like repeat 10 times.

    And then simply use -> on finished "idle" animation -> play "blink" -> on finished "blink" -> play idle.

    But if you want to add more randomness, using a timer system when idle will give you more control over it.

    Using wait action like you did will confuse the engine as it will remember that it is waiting for something (and it will trigger each time you stop, stacking all the previous wait action on top of each other), so if you start walking after being idle, the engine will still run the idle wait action even though you are moving.

  • Example made in beta r250

    Animation used from the "Toon characters" pack on kenney.nl

  • You can also set it to random, between 1 and 3 seconds so it does not look the same every time.

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