-
Let's say there are 100 entities with the same descriptor (only has position component, for the sake of the hypothetical) in a networked game, and only one of them is moving. Because of delta compression, only the moving entity has its position sent. What would be the intended way to handle receiving and applying the position update to that particular entity? I would use QueryEntity, but the entity could come from one of a few groups, so I would have to iterate over each group. This means only one of the groups would have the entity. I can't null check because QueryEntity returns a struct. I would naturally look to TryGetEntity, but it does not seem to support unmanaged types, which means it cannot retrieve ViewComponents (which is what my desired component is). |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
as long as you have an EGID available, you can query directly an Entity. There are two ways to do this: first one is to use (Try)QueryEntitiesAndIndices
the reason to return the array and the indices is that then you can reuse the index for other arrays like in the example second one is to use an EGIDMapper
|
Beta Was this translation helpful? Give feedback.
as long as you have an EGID available, you can query directly an Entity. There are two ways to do this:
first one is to use (Try)QueryEntitiesAndIndices