Skip to content

Query<EntityMut> system param unexpectedly conflicts with some Res<T> one #15621

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
djeedai opened this issue Oct 3, 2024 · 6 comments
Closed
Labels
A-ECS Entities, components, systems, and events C-Bug An unexpected or incorrect behavior D-Domain-Expert Requires deep knowledge in a given domain S-Needs-Investigation This issue requires detective work to figure out what's going wrong

Comments

@djeedai
Copy link
Contributor

djeedai commented Oct 3, 2024

Bevy version

0.14.2

What you did

pub fn component_animator_system(
    time: Res<Time>,
    events: ResMut<Events<TweenCompleted>>,
    mut q_anim: Query<EntityMut, With<Animator>>,
) {

What went wrong

The component query conflicts with the resources:

bevy_ecs-0.14.2/src/system/system_param.rs:302:5:
error[B0001]: Query<bevy_ecs::world::entity_ref::EntityMut, bevy_ecs::query::filter::With<bevy_tweening::Animator>> in system bevy_tweening::plugin::component_animator_system accesses component(s) bevy_ecs::event::Events<bevy_tweening::tweenable::TweenCompleted>, bevy_time::time::Time in a way that conflicts with a previous system parameter. Consider using `Without<T>` to create disjoint Queries or merging conflicting Queries into a `ParamSet`. See: https://bevyengine.org/learn/errors/#b0001

Asked on #ecs-dev, this looks like an error, as component queries shouldn't conflict with resources.

@djeedai djeedai added A-ECS Entities, components, systems, and events C-Bug An unexpected or incorrect behavior D-Domain-Expert Requires deep knowledge in a given domain S-Needs-Investigation This issue requires detective work to figure out what's going wrong labels Oct 3, 2024
@djeedai
Copy link
Contributor Author

djeedai commented Oct 3, 2024

Commenting out the ResMut<Events<T>> doesn't change anything. So this is not due to the mutability access of the resource.

@BorisBoutillier
Copy link
Contributor

Minimalist full example reproducing the issue:

use bevy::prelude::*;

fn main() {
    App::new().add_systems(Update, test_system).run();
}

pub fn test_system(time: Res<Time>, mut query: Query<EntityMut>) {}

@alice-i-cecile
Copy link
Member

Can you check on main? I remember merging a related fix.

@BorisBoutillier
Copy link
Contributor

I have checked on main my minimal example and it no more report any conflicts.
I'll try to find out the associated PR that fixes this for reference.

@djeedai
Copy link
Contributor Author

djeedai commented Oct 3, 2024

Sorry my bad I didn't think about checking main. 😬

@BorisBoutillier
Copy link
Contributor

This is the same issue as #13139 and this is effectively fixed with the associated PR #14561

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Bug An unexpected or incorrect behavior D-Domain-Expert Requires deep knowledge in a given domain S-Needs-Investigation This issue requires detective work to figure out what's going wrong
Projects
None yet
Development

No branches or pull requests

3 participants