Search Unity

How to get entity data from a different chunk?

Discussion in 'Entity Component System' started by Rom-, Aug 5, 2019.

  1. Rom-

    Rom-

    Joined:
    Nov 26, 2008
    Posts:
    90
    So I'm trying to make entity positions follow each other. I can get 90% of the way there by iterating through a chunk and have the positions update according to the next entity in the list. The problem is when I get to the end of the chunk, I'm not sure how to get the first entity in the next chunk to do the follow calculation.
     
  2. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    4,267
    Use CreateArchetypeChunkArray and IJob instead of IJobChunk so that you can access multiple chunks at once.