How do I pause and resume a looping tween?

0 favourites
  • 3 posts
From the Asset Store
For Adventure, Action, Heroes, Sci-fi and Action-RPG games.
  • I can't figure out for the life of me why the below code is not working. Is there something I've missed? The tween seems to just end on pause rather than actually being paused.

    + System: On start of layout

    -> crusher: Tween "crush" property Y to crusher.endValue in crusher.crushDuration seconds (In Exponential, destroy: No, loop: Yes, ping pong: Yes, repeat count: 1)

    + crusher: On any Tween looped

    -> crusher: Tween: Pause all

    -> crusher: Start Timer "wait" for crusher.wait (Once)

    -> crusher: Set animation frame to 1

    + crusher: On Timer "wait"

    -> crusher: Set animation frame to 0

    -> crusher: Tween: Resume all

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Could be a bug. You might as well just restart the tween in "On timer" event.

  • Yeah for now I've changed the code so a new tween is started on the timer trigger rather than a looping tween. Just thought pause/resume seemed like a cleaner way of doing it.

    I can't get the pause / resume to work using any of the tween triggers: on tween looped, on tween ping-pong start / end / either. They all trigger the tween to go straight to "finished" (tested using the "on finished" trigger).

    However if I control the pause manually (e.g. through a button press), the code works as intended.

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