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.
  2. Dismiss Notice

Resolved Get collider from compound at root entity?

Discussion in 'Physics for ECS' started by Bas-Smit, Sep 12, 2023.

  1. Bas-Smit

    Bas-Smit

    Joined:
    Dec 23, 2012
    Posts:
    272
    I have a compound collider and I would like to obtain the collider that represents the physics shape attached to the root entity, can anyone enlighten me?

    Root Entity
    | - body
    | - shape <= looking for this one
    - Child Entity
    - shape
     
  2. Bas-Smit

    Bas-Smit

    Joined:
    Dec 23, 2012
    Posts:
    272
    collider->GetLeaf(new ColliderKey(1, 0), out var c))