Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upClock synchronization issue #560
Comments
That change may work for your case, but I think it may break individually-controlled Tweens. If interested to make a PR but adding this feature behind an API more like |
Do you have a code snippet that demonstrates what issue you had? |
I don't have a code snippet, but here is how you can recreate it:
You've provided control of the internal clock, but you don't use the custom clock values when you start a tween, so they start in a different timeframe than the updates. |
Interesting, haven't used it like that before. Normally what I do is control every tween individually, which may be a workaround for now: const tween = new Tween(...)....start(startTime)
// ...
tween.update(newTime) That way each tween can operate with its own custom time being passed in (plus easier to encapsulate the tween to a particular component of your UI, pause it individually, update it individually, etc, while other tweens in other components can also do their own thing). |
When controlling the clock by passing a value to
TWEEN.update(...)
, the default_startTime
for a tween started with.start()
still uses the browser clock, which means tweens do not behave as expected. I've fixed this in my own code by redefiningTWEEN.now
to return the last value I sent to.update(...)
. It seems to me that if its in a "controlled mode", everything should use those controlled values.