From 48af029f7ba4d16be349c2cc5a76e2f5c8ce9f95 Mon Sep 17 00:00:00 2001 From: Stepan Koltsov Date: Thu, 23 Nov 2023 14:04:07 +0000 Subject: [PATCH] Warn that Added/Changed filters do not see deferred changes (#10681) Explain https://github.com/bevyengine/bevy/issues/10625. This might be obvious to those familiar with Bevy internals, but it surprised me. --------- Co-authored-by: Alice Cecile --- crates/bevy_ecs/src/query/filter.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/crates/bevy_ecs/src/query/filter.rs b/crates/bevy_ecs/src/query/filter.rs index 9db8fbf36c..7d958fe874 100644 --- a/crates/bevy_ecs/src/query/filter.rs +++ b/crates/bevy_ecs/src/query/filter.rs @@ -551,6 +551,12 @@ impl_tick_filter!( /// To retain all results without filtering but still check whether they were added after the /// system last ran, use [`Ref`](crate::change_detection::Ref). /// + /// # Deferred + /// + /// Note, that entity modifications issued with [`Commands`](crate::system::Commands) + /// are visible only after deferred operations are applied, + /// typically at the end of the schedule iteration. + /// /// # Examples /// /// ``` @@ -587,6 +593,13 @@ impl_tick_filter!( /// To retain all results without filtering but still check whether they were changed after the /// system last ran, use [`Ref`](crate::change_detection::Ref). /// + /// # Deferred + /// + /// Note, that entity modifications issued with [`Commands`](crate::system::Commands) + /// (like entity creation or entity component addition or removal) + /// are visible only after deferred operations are applied, + /// typically at the end of the schedule iteration. + /// /// # Examples /// /// ```