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
I started playing around with bevy (super cool) and it was quite exasperating to be unable to make for-each system with mutable components. Most of the frustration comes from the compiler giving useless feedback about not being able to build a system from the function. Also, most of the examples used query systems for these cases, so it was hard to find.
After converting everything to a query, I stumbled upon this in the Bevy-Cheatsheet:
You must use Mut instead of &mut T.
It would be cool if you could mention it in the book. I tried to look for it but I could not find it or, maybe, this pattern is discouraged, but it would also be worth mentioning it.
The text was updated successfully, but these errors were encountered:
Yeah the book is pretty lacking in a number of places, but Mut<T> is a pretty major omission that a lot of people slip up on. I'm delaying Book work while we stabilize things, but slipping Mut<T> in there now seems like the right call.
Hello!
I started playing around with bevy (super cool) and it was quite exasperating to be unable to make for-each system with mutable components. Most of the frustration comes from the compiler giving useless feedback about not being able to build a system from the function. Also, most of the examples used query systems for these cases, so it was hard to find.
After converting everything to a query, I stumbled upon this in the Bevy-Cheatsheet:
It would be cool if you could mention it in the book. I tried to look for it but I could not find it or, maybe, this pattern is discouraged, but it would also be worth mentioning it.
The text was updated successfully, but these errors were encountered: