Replies: 2 comments 3 replies
-
A timer with 0 time is malformed. We should instead panic on new if the 0 The use case of wanting the Timer to 'trigger next time' seems like it should just be stored in a piece of non- |
Beta Was this translation helpful? Give feedback.
3 replies
-
To have a let duration = Duration::from_secs_f32(19.0);
let mut new_timer = Timer::new(duration, true);
new_timer.set_elapsed(duration); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Minimum Sample
In 0.5 this will internally cause a
nan f32
, which will saturate to0u32
and not error. As of #2362 it will throw an error and crash the program, since this piece of math has been converted tof128
, which doesn't saturate on casts.I'm a bit unsure whether to put in a PR to fix it, since the usecase here is fairly marginal (eg setting a timer to 0 duration to ensure it will hit on the next loop, etc). A fix here, on the other hand, could possibly have some performance penalties.
I'm fairly new to bevy, what's the move?
Beta Was this translation helpful? Give feedback.
All reactions