Search Unity

Resolved Accessing All Hit Bodies in Unity.Physics Collision Queries

Discussion in 'Physics for ECS' started by Opeth001, May 25, 2023.

  1. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,117
    Hello Everyone,
    I have noticed that the Unity.Physics queries only provide information about the closest hit body, and I have been unable to locate the corresponding API to retrieve all of the hits.

    Thank you.
     
  2. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,117
    I just find out about the AllHitsCollector.
     
  3. daniel-holz

    daniel-holz

    Unity Technologies

    Joined:
    Sep 17, 2021
    Posts:
    278
    Glad you found this. I suppose this solves your issue, correct?
     
    Opeth001 likes this.
  4. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,117
    Yes thanks :)
     
    daniel-holz likes this.