diff --git a/packages/dev/core/src/Animations/animatable.ts b/packages/dev/core/src/Animations/animatable.ts index 740e4afb9f9..a4a37613656 100644 --- a/packages/dev/core/src/Animations/animatable.ts +++ b/packages/dev/core/src/Animations/animatable.ts @@ -23,6 +23,7 @@ export class Animatable { private _weight = -1.0; private _syncRoot: Nullable = null; private _frameToSyncFromJump: Nullable = null; + private _goToFrame: Nullable = null; /** * Gets or sets a boolean indicating if the animatable must be disposed and removed at the end of the animation. @@ -96,6 +97,11 @@ export class Animatable { animation._prepareForSpeedRatioChange(value); } this._speedRatio = value; + + // Resync _manualJumpDelay in case goToFrame was called before speedRatio was set. + if (this._goToFrame !== null) { + this.goToFrame(this._goToFrame); + } } /** @@ -281,6 +287,8 @@ export class Animatable { for (let index = 0; index < runtimeAnimations.length; index++) { runtimeAnimations[index].goToFrame(frame); } + + this._goToFrame = frame; } /** @@ -398,6 +406,8 @@ export class Animatable { this._frameToSyncFromJump = null; } + this._goToFrame = null; + if (this._weight === 0) { // We consider that an animation with a weight === 0 is "actively" paused return true;