vestigial thank you !
actually i just want to calculate the distance between each entity and the other entities, so if one entity is close enough to the other entity some functions will be run on it
something look like OnTriggerEnter
But I don’t know what is the best way to do this XD
how can i loop throw other entities Translations ?
Ooh, in that case yeah I guess looping through all of them makes sense. Sorry. I’m sure there are all kinds of optimizations for that. The DOTS physics package might have some kind of OnTriggerEnter
The way most people do this is to use EntityQuery.ToComponentDataArray/ToEntityArray for the components they want to read.
The more advanced way is to use manual chunk iteration.
The most advanced way is to use an intermediate acceleration structure so that your algorithm can run in O(n log n) rather than O(n^2). Though this strategy is only worth it if you have a few hundred entities or already have the algorithm written.