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
Is it possible to do nested for loops simply within system iterations? If I call join on a &mut component then try to iterate inside that component using join again, the borrow checker complains. What is the intended way to have every entity operate on every entity as an example, mutably.
The text was updated successfully, but these errors were encountered:
You can't mutably borrow twice. What are you trying to do? Perhaps it can be rewritten because this is, as you said, a borrow checker issue with your implementation and not specs-specific
There are many ways to do it and it's been answered a lot on stackoverflow depending on your situation, which you won't give details on. You can split the iterator, copy it and walk that, use interior mutability, or pass a message to another system and have that other system mutate it. Or just rewrite it to not have a nested loop. If it's for collision, you can use ncollide and just query the collision world.
Is it possible to do nested for loops simply within system iterations? If I call join on a &mut component then try to iterate inside that component using join again, the borrow checker complains. What is the intended way to have every entity operate on every entity as an example, mutably.
The text was updated successfully, but these errors were encountered: