How to access the data of a custom component?

i have 2 custom components in 2 separate files. each component is added to a separate entity in a scene.
how can i access the β€œdata:” property of one component from another component?
somehow when i call
CustomComponent.get(world, customComponentEid)
I get {}, but I expect to get the actual component

How can I fix it?

In general the best design pattern at the moment is using a event dispatcher and event listener to communicate between entities, and exchange data. It’s a little different from the Unity approach where you grab a component directly from an entity and call some function on it.

1 Like