bevy_tweening icon indicating copy to clipboard operation
bevy_tweening copied to clipboard

Figure out what to do in tick when tween is completed via set_{elapsed,progress}

Open SUPERCILEX opened this issue 3 years ago • 3 comments

Currently we'll block you from updating the underlying structure if the tween is complete, but we should probably remove that optimization or keep track of whether or not the underlying was updated and perform the update even if the tween is completed.

SUPERCILEX avatar Aug 04 '22 01:08 SUPERCILEX

What does that mean exactly? Are you saying that when the tweenable completes, we can't use tick() anymore (fine, probably)? Or that the last tick that completes the tweenable does not apply its changes to the underlying object (component/asset), which would be a bug?

djeedai avatar Aug 10 '22 08:08 djeedai

Are you saying that when the tweenable completes, we can't use tick() anymore (fine, probably)?

Yes, pretty much. This behavior has been around for as long as I can tell, but it feels wrong. Here's some pseudo code:

let transform;
let tween = from transform;
tween.set_elapsed MAX OR tween.set_progress 1. // Complete the tween somehow
tween.tick

// transform is not updated

If this is the desired behavior, we should document it. Though I feel like the transform should be updated.

SUPERCILEX avatar Aug 10 '22 13:08 SUPERCILEX

Ah right, in that case indeed it's bad the transform doesn't get updated

djeedai avatar Aug 18 '22 18:08 djeedai