Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

CollisionWorld.CalculateDistance order of hits

Discussion in 'Physics for ECS' started by the80srobot, Sep 6, 2020.

  1. the80srobot

    the80srobot

    Joined:
    Apr 5, 2020
    Posts:
    47
    Quick question that I can't find the answer to in the docs: do the CalculateDistance overloads which take a reference to a list of hits fill the list in a deterministic order (maybe from the closest to the most distant)?
     
  2. petarmHavok

    petarmHavok

    Joined:
    Nov 20, 2018
    Posts:
    461
    The order is deterministic as in running multiple times will always fill the list in the same order. However, hits are not sorted based on distance in any way.