-
-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting new value of shared component disconnects sharing #179
Comments
This is actually by design. A You can do the same as in this article like this: |
Isn't that contrary to what docs are saying:
also, just below SetSameAs:
nowhere does it say that only one method is valid for shared components. What you described is actually the functionality I was hoping for: changing the value in the source would cause WhenChanged event fire for every entity that shares the component. This way I could change the color value of the whole team. |
oh definitely, it was working like that but was changed afterward and I forgot to edit the readme I'll update it. I'll add some comment on the methods too to better reflect that. Also you don't really "need" the change event, well it depends... if your system only ready the component value it doesn't need it and |
Hi,
not sure if this a bug or I am missing something but component sharing does not work form me, I do:
at this point I see single Color component in World components
then
still seeing a singe Color component in the World.
at this point there are 2 Color components in the World, the "prefab" using new one and and "instances" share the one at index 0 meaning I see no change of the color for the instances after changing the shared color of the "prefab".
(trying to emulate https://ajmmertens.medium.com/deconstructing-flecs-prefabs-d604b5ba0fcc with DefaultEcs)
The text was updated successfully, but these errors were encountered: