-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Time<Real> (in bevy 0.12) #106
Comments
I see how that can be useful, however I have a few questions (not necessarily to you):
|
I should add that my experience with Unity has been that time scaling is seldomly used, as it's too broad. If you want to implement a "pause system" (generic term here for anything that needs to tick only sometimes) then it's often better to do that manually with a custom time source that you manage, as opposed to an engine built-in one which has various assumptions as to what does and doesn't pause. That being said the Bevy API is more extensible so maybe we'll see broader usage. |
The bool (or enum) was just a suggestion for the simplest approach with the least breaking changes that would still cover most use cases.
I'd venture a guess that would be confusing for end users if the default time for tweening would be different from default bevy time. |
I've done just jam games and in those cases having the basic time scaling was good enough. For bevy jam games I've used a bare-bones resource wrapped in a system param, but I'm gonna switch to the new time API which is indeed much nicer than the Unity one. I wouldn't mind tackling this, but only if you think it would make sense for this plugin and point me in the proper direction the impl should take (ie. generic vs enum/bool field) 🙂. |
Since support for bevy 0.12 has been merged, I've messed around with the generic approach, but I've encountered an issue: |
I've settled on a marker trait to exclude @djeedai Any thoughts? I can close this if you don't think it would be useful and I'll just use it in my fork. |
I'd like to support this change! I can't use bevy_tweening at the moment because my game uses Time Virtual for gameplay and Time Real for UI. I need the ability to continue to tween over Time Real even if the game is paused Time Virtual or be able to specify this on a per-tween basis. fwiw, I don't think this is an enhancement, but a requirement given how Bevy's Time resource works in 0.12+ |
I'm still down to finish this if @djeedai would consider it a worthy addition. Otherwise I'm just gonna close it as a stale issue. |
I mean, to be clear it seems a very good addition to be supporting the various @SecretPocketCat I had a look at your WIP branch, that looks a priori like a good start. I think it's maybe just missing to confirm the default |
Great, I will finish the PR then including a couple new tests, docs & adding the same to assets. I'm a bit busy at the moment, but I'll come back to it when I get the chance. |
This's is just a prep issue for the upcoming bevy 0.12 release.
Time scaling was added in bevyengine/bevy#8964 with
Time<()>
being the default. In normal systems that'sTime<Virtual>
(scaled) which makes sense, but it would be nice to be able to animate in unscaled time (Time<Real>
) (e.g. for a pause UI).Adding a field to Animator like
use_real_time: bool
and adding the appropriate builder functions might do the trick for the API.The text was updated successfully, but these errors were encountered: