-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Issue with custom WorldQuery with Changed and mutable #10147
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
Comments
That seems like a super confusing error. But I think the root of your problem is that there are two generic arguments in
I think the best you can do here is derive a second #[derive(WorldQuery)]
struct MyQueryFilter {
changed: Changed<MyComponent>
} and do
It also seems like you might want SystemParam instead. |
This should be fixed with #9918 as a result. |
thank you, also thanks for the tip with SystemParam that is great to cleaning up my code even more |
Changed directly reads the change ticks of each component. |
Bevy version
0.11.3
What you did
I tried to cleanup a system query, I made a full example here:
What went wrong
The error on my_system2 / MyQuery2 was '$state_name<bevy_minimal::MyComponent> conflicts with a previous access in this query. Shared access cannot coincide with exclusive access.'.
Backtrace:
This only happens when I use "&mut MyComponent" with a "Changed", otherwise WorldQuery works as expected.
This specific case is not mentioned in the examples: https://github.com/bevyengine/bevy/blob/main/examples/ecs/custom_query_param.rs
As an aside, I found those examples in custom_query_param.rs really difficult to understand but perhaps that's just me, at first I thought I was doing something wrong, or perhaps I am?
The text was updated successfully, but these errors were encountered: