Method GetLeafCollider
GetLeafCollider(out ChildCollider, Collider*, ColliderKey, RigidTransform, float)
Get a leaf of a collider hierarchy. Return false if the key is not valid for the collider.
Declaration
public static bool GetLeafCollider(out ChildCollider leaf, Collider* root, ColliderKey key, RigidTransform rootTransform, float rootUniformScale = 1)
Parameters
| Type | Name | Description |
|---|---|---|
| ChildCollider | leaf | [out] The leaf collider in world space. |
| Collider* | root | [in,out] If non-null, the root collider. |
| ColliderKey | key | The key identifying the leaf collider. |
| RigidTransform | rootTransform | The root transform in world space. |
| float | rootUniformScale | (Optional) The root uniform scale. |
Returns
| Type | Description |
|---|---|
| bool | True if there is a leaf with the specified collider key, false otherwise. |