Jump to content

Is there a way to resume tween from the start?


mazoku
 Share

Recommended Posts

Sorry but nothing of these is not answering my question. I need something like calling stop and then start again. Pause is stopping the tween and resume continues from where it starts. After stop the tween is marked for deletion and has some strange behavior. 

Link to comment
Share on other sites

I don't think tweens are designed to be fiddled like timers. It just starts and works until it reaches the end state.

You can pause it but cannot reset it.

Recreate the tween with same settings, to reset it from start, maybe?

You could also play with timers and set properties of game objects with timers. But I don't know how Yoyo curve looks like :D

Set a value for a game object property calculated by Yoyo function at a given time. :D Since it will be a timer, you can stop, pause, reset, loop...

Link to comment
Share on other sites

here is an example of how you can reset the same tween without adding a new one:

The key parameter that determines where the tween continues is found in the timeline property of the tween :

tween.timeline[0].dt

. If you reset that to 0 it will start from the beginning. The example has a bit more features where it resets the tween when pressing the A button. However, its more tedious to work this way and the simplest way out is to add it again, but if you really require the same tween then this could be a solution.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...