Skip to content
Discussion options

You must be logged in to vote

You likely want to remove the C: WorldQuery bound and use Query<(Entity, &C), With<M>> instead of your current query.

Explanation of what happened: queries over some WorldQuery C will yield values of type <C as WorldQuery>::Item<'w>. For example if C was &mut T (for some T: Component) then the values yielded will be of type bevy::ecs::change_detection::Mut<'w, T>. For &C however the query item is also &C, so there shouldn't be problems. Also, generally a Component C is not a valid WorldQuery, but &C and &mut C are, hence why I suggested you to remove the C: WorldQuery bound.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bbarker
Comment options

Answer selected by bbarker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants