Fix: Move DiagnosticsOverlay Setup to PreStartup Schedule (#24433)
# Objective - Fixes #24377 - One of the regressions was already fixed by #24019 . The other regression (caused seemingly by merely adding TransformGizmo functionality) revealed a potential system ordering issue when using the `DiagnosticsOverlayPlugin`: If one setups `DiagnosticsOverlay`s in the `Startup` schedule, the `build_overlays` observer could fail silently because the `DiagnosticsOverlayPlane` (which is also created in the `Startup` schedule) may not have been created yet. ## Solution Move the system that sets up the`DiagnosticsOverlayPlane` into the `PreStartup` schedule. ## Testing - Copied the “What I did” section in https://github.com/bevyengine/bevy/issues/24377 (`cargo run --release --example scene_viewer --features="free_camera bevy_dev_tools" assets/models/FlightHelmet/FlightHelmet.gltf` after the scene_viewer has been modified as described). The overlay now appears and works correctly.
K
Kevin Chen committed
5dc6e46981844ff1c05b9e1425ef6be627e2c144
Parent: a3600c1
Committed by GitHub <noreply@github.com>
on 5/28/2026, 10:39:01 PM