ok so last week i asked in #general about why my game randomly doubled in tick/frame rate, player and animations moved twice as fast, etc.
It was because i was setting up my fixed time/update stuff wrong.
However today i found 2 new pieces of info:
-
it doesnt work ๐
-
macOS seems to optimize something while plugged into a power source vs not plugged in, because as SOON as i plug in, i get the double speed symptoms, and when i plug out, i go back to "normal" or expected behaviour. Weird, but cool
my set up for fixed updates is:
pub const TIME_STEP: f32 = 1.0 / 60.0;
#[derive(Debug, Hash, PartialEq, Eq, Clone, SystemSet)]
#[system_set(base)]
pub enum CoreGameSet {
Main,
}
app.edit_schedule(CoreSchedule::FixedUpdate, |s| {
s.configure_set(CoreGameSet::Main.run_if(in_state(GameState::Main)));
})
.insert_resource(FixedTime::new_from_secs(TIME_STEP));
//in my input system
app.add_systems(
(
Self::move_player,
... other systems
)
.in_base_set(CoreGameSet::Main),
)
Im not sure what else i need to do and why this isnt working lol