diff --git a/crates/bevy_ecs/src/resource/resource_query.rs b/crates/bevy_ecs/src/resource/resource_query.rs index 267f45a8a09e8..92742343b47c6 100644 --- a/crates/bevy_ecs/src/resource/resource_query.rs +++ b/crates/bevy_ecs/src/resource/resource_query.rs @@ -297,9 +297,13 @@ impl<'a, T: Resource + FromResources> ResourceQuery for Local<'a, T> { type Fetch = FetchResourceLocalMut; fn initialize(resources: &mut Resources, id: Option) { - let value = T::from_resources(resources); let id = id.expect("Local resources can only be used by systems"); - resources.insert_local(id, value); + + // Only add the local resource if it doesn't already exist for this system + if resources.get_local::(id).is_none() { + let value = T::from_resources(resources); + resources.insert_local(id, value); + } } }