All Questions

Community

C
Aipie

get_overlapping_areas and order

when you call _range_area.get_overlapping_areas() does the list returned always return the areas in the same order?
So two enemies overlap (E1 and E2).
Do you always get it back as E1, E2
or could it be that it sometimes also returns as E2, E1
and you end up shooting sometimes to the first enemy and sometimes to the second enemy
  • D
    spaceyjase replied
    Solution

    The order isn't guaranteed - it is based on an internal ID so could be E1 and E2, or E2 and E1 depending on the engine internals. However, once the order is established and they (enemies) remain in the area, the order will likely be maintained.

    You could test it too and see what happens!