You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently there is not a way to mutate a component that has been provided to a QueryBorrow with the Added/Mutated/Changed series of structs that impl Query. These structs do not implement DerefMut, so there isn't a safe way to get a mutable reference to the component. It was suggested in Discord that new writable change detection pointers could be the path forward on this, e.g.MutatedMut, ChangedMut, AddedMut` that would allow inner mutability of the value and track the changes made.
The work around I am using for this is are multiple component queries with mut versions of the components and entity comparisons, but it is a bit clunky - if there is a better work around that I'm missing, it would also be appreciated.
The text was updated successfully, but these errors were encountered:
Currently there is not a way to mutate a component that has been provided to a
QueryBorrow
with theAdded
/Mutated
/Changed
series of structs that implQuery
. These structs do not implement DerefMut, so there isn't a safe way to get a mutable reference to the component.It was suggested in Discord that new writable change detection pointers could be the path forward on this, e.g.
MutatedMut,
ChangedMut,
AddedMut` that would allow inner mutability of the value and track the changes made.The work around I am using for this is are multiple component queries with mut versions of the components and entity comparisons, but it is a bit clunky - if there is a better work around that I'm missing, it would also be appreciated.
The text was updated successfully, but these errors were encountered: