Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions src/schedule/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,13 +253,11 @@ fn run_physics_schedule(world: &mut World, mut is_first_run: Local<IsFirstRun>)
schedule.run(world);
}

// If physics is paused, reset delta time to stop the simulation
// unless users manually advance `Time<Physics>`.
if is_paused {
world
.resource_mut::<Time<Physics>>()
.advance_by(Duration::ZERO);
}
// Reset delta time, to continue the simulation `Time<Physics>`
// must be unpaused or manually advanced by users.
world
.resource_mut::<Time<Physics>>()
.advance_by(Duration::ZERO);

// Set the generic `Time` resource back to the clock that was active before physics.
*world.resource_mut::<Time>() = old_clock;
Expand Down
Loading