ten3roberts / flax

Batteries included ECS library for rust with entity relations and much more
78 stars 5 forks source link

How can I make relations_like mutable? #22

Closed nikitabel229 closed 6 months ago

nikitabel229 commented 6 months ago

I have this thingy, I want the &f32 to be &mut f32. I thought that since relations are like components you could just do as_mut, but there's no as_mut here image

ten3roberts commented 6 months ago

Yes, that is correct, relations are normal components but require the target to be specified relationship(my_entity) so that we know which piece of data we are talking about since there can be multiple ones.

As for the wildcard relations_like mutable access, I've added it in #23 , and will push a new version shortly, there's a new test for it too which would give you about what you want for usage

nikitabel229 commented 6 months ago

Yay it works now, thanks image