Skip to content

feat: make TweeningPlugin generic over Time - #168

Open
kmorrisongr wants to merge 1 commit into
djeedai:mainfrom
kmorrisongr:feat/generic-over-time
Open

feat: make TweeningPlugin generic over Time#168
kmorrisongr wants to merge 1 commit into
djeedai:mainfrom
kmorrisongr:feat/generic-over-time

Conversation

@kmorrisongr

@kmorrisongr kmorrisongr commented Feb 21, 2026

Copy link
Copy Markdown

Closes #106

Example usage:

TweeningPlugin::<Real>::default()
TweeningPlugin::<Virtual>::default()
// Use bevy default
TweeningPlugin::<()>::default()

My use case is a tower defense game. I have very nice animations that bevy_tweening made it trivial to implement for placing towers. I use Time<Virtual> in game, because I have pause, 1x, 2x, 3x speed controls.

This works fine for wave-based logic and animations. However, it means that animations for placing towers do not play while the game is paused.

This is a breaking change, because you can no longer use a bare TweeningPlugin when adding it, you need to use TweeningPlugin::default().

I had hoped to implement more granular control, but found that animator_system applies delta_time to all tweens.

I also recognize that there might be a better way to implement this. This was implemented by Claude Opus 4.6 via VSCode Copilot. My confidence in its functionality was given by:

  • tests pass
  • my animations now play when the game is paused and while it is unpaused

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Time<Real> (in bevy 0.12)

1 participant