Setting duration of looping animations

  • My file: dropbox.com/s/svllzhvoczdit2y/Animation%20Test2.capx

    Intended behviour:

    On start of layout, Deer spawn with a randomly chosen idle animation (this part works)

    After that, you can see the following conditions for when different animations finish; i.e. if the DeerUp animation finishes playing, then choose from two other idle animations to play after.

    The problem is with the two idle animations (DeerEat, DeerWag) that are set to both Loop and Ping-Pong. I want them to play for a set amount of time (which I tried to do using Wait and random(3,6)), and then go into the appropriate animation afterwards.

    But because they're on loop, I can't use the On Animation Finished event. If I use the Is Playing event, it seems to go into some kind of logic loop (the animations are 'always playing)) and I end up with animation errors. Notably, hyper-headbanging Deer.

    I've tried using sub-events, but they will not work for the looping animations. You can also see two other events->actions I put on disabled after testing. They worked fine for the two 'normal' animations as event triggers on them finishing.

    Any help would be greatly appreciated!

    Edit: Testing with rex's Duration behaviour - scirra.com/forum/behavior-duration_topic53395.html

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Boop

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