Replies: 1 comment 2 replies
-
Not sure if this is a Fleks specific question. The way I usually solve entity relations is via components. I don't know if this is the best way to do it but it works for me. As an idea how I would solve your problem:
I use a similar approach for collision handling. I usually have a Collision component that is added to an entity and contains a list of entities that it collided with within one frame. Anyway, I suggest to solve entity relations via components as well. That should be the most flexible solution. |
Beta Was this translation helpful? Give feedback.
-
I am trying to find out a way to express one-to-many relationship in Fleks. Say I have multiple
Units
, each can have a number ofWeapons
. EachUnit
andWeapon
also have a number of components.Is this possible? I don't see a way to, say, add a "child entity".
Beta Was this translation helpful? Give feedback.
All reactions