diff --git a/backends/bevy_picking_egui/src/lib.rs b/backends/bevy_picking_egui/src/lib.rs index 13f287fa..0093e8bc 100644 --- a/backends/bevy_picking_egui/src/lib.rs +++ b/backends/bevy_picking_egui/src/lib.rs @@ -1,11 +1,12 @@ -//! A raycasting backend for [`bevy_egui`] +//! A raycasting backend for [`bevy_egui`]. This backend simply ensures that egui blocks other +//! entities from being picked. #![allow(clippy::type_complexity)] #![allow(clippy::too_many_arguments)] #![deny(missing_docs)] use bevy::{prelude::*, render::camera::NormalizedRenderTarget}; -use bevy_egui::EguiContext; +use bevy_egui::{EguiContext, EguiSet}; use bevy_picking_core::backend::prelude::*; /// Commonly used imports for the [`bevy_picking_egui`](crate) crate. @@ -20,8 +21,12 @@ pub struct EguiBackend; impl PickingBackend for EguiBackend {} impl Plugin for EguiBackend { fn build(&self, app: &mut App) { - app.add_system(egui_picking.in_set(PickSet::Backend)) - .insert_resource(EguiBackendSettings::default()); + app.add_system( + egui_picking + .in_set(PickSet::Backend) + .after(EguiSet::BeginFrame), + ) + .insert_resource(EguiBackendSettings::default()); #[cfg(feature = "selection")] app.add_system(update_settings.in_base_set(CoreSet::First));