Skip to content

Commit

Permalink
Move setup_entities to Startup phase
Browse files Browse the repository at this point in the history
Running setup_entities during the Update phase was causing major performance issues. It should only need to be called once. Otherwise the example will hit major frame rate and memory issues.
  • Loading branch information
Nashenas88 authored Dec 5, 2024
1 parent efd7291 commit 8c9bbfe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/cu_rp_balancebot/src/world/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ pub fn build_world(app: &mut App) -> &mut App {
.insert_resource(Time::<Physics>::default())
.add_systems(Startup, setup_scene)
.add_systems(Startup, setup_ui)
.add_systems(Update, setup_entities)
.add_systems(Startup, setup_entities)
.add_systems(Update, toggle_simulation_state)
.add_systems(Update, camera_control_system)
.add_systems(Update, update_physics)
Expand Down

0 comments on commit 8c9bbfe

Please sign in to comment.