Setting _localDelayOffset of an Animatable in the constructor to the scene._animationTime property?

I’m implementing a rollback networking model for a fighting game and setting the _localDelayOffset property to null at first is causing some issues when I do rollback to a previous step and then resimulate to the current step.
I want to ask if it makes more sense to set the _localDelayOffset property of Animatable in its constructor to this._localDeaylOffset = this._scene._animationTime when we start an animation instead of being null by default?
I think it would be more deterministic.

cc @Deltakosh

Well by setting it to animation time we have the risk to have a tiny difference at startup (for the animation).

That being said, elapsedTime should still return 0 if you do it on the same frame. but I also imagine people creating animation but not starting them right away. For them it will introduce an animation keyframe skip.

Maybe I can add an option in the constructor ?


Yes, it is a very good idea. Can you add this option to animation groups as well?

1 Like

Fancy trying doing a PR? I can review it with pleasure