Hi đź‘‹
I have a query like
Query<&mut MyComponent>
and I want to detect if the component has changed by using the new my_component.is_changed() function of Ref
But if I switch my query to Query<Ref<MyComponent>> then I lose the mutability, and I need it
I read in the documentation about Ref (https://docs.rs/bevy/latest/bevy/prelude/struct.Ref.html) I quote: Similar to Mut but is immutable and so doesn’t require unique access., but it's misleading because I can't just replace it by Query<Mut<MyComponent>>
If I do that, I get an error like this:
error: the trait bound `bevy::prelude::Mut<'_, my_crate::MyComponent>: WorldQuery` is not satisfied
label: the trait `WorldQuery` is not implemented for `bevy::prelude::Mut<'_, my_crate::MyComponent>`
Am I doing something wrong, or I did missunderstand the docs? 🤔
Shared borrow of an entity’s component with access to change detection. Similar to Mut but is immutable and so doesn’t require unique access.