Search Unity

Feedback Physics.RaycastAll order returned undefined?!

Discussion in 'Physics' started by andyz, Jan 18, 2021.

  1. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,277
    Unity - Scripting API: Physics.RaycastAll (unity3d.com)
    says "Casts a ray through the Scene and returns all hits. Note that order of the results is undefined."

    While you can sort the returned results from Physics.RaycastAll by distance, I am wondering why this is not done by default? Is that because physx is that way?

    Also the docs do not say if null or empty array returned on no hits, which would just be a nice thing to mention!