GetContactColliders(ContactFilter2D, Allocator)
Retrieves all colliders in contact with this Rigidbody, with the results filtered by the contactFilter.
Read time 1 minuteLast updated 12 days ago
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.Physics2DModule
public ColliderArray2D GetContactColliders(ContactFilter2D contactFilter, Allocator allocator = Allocator.Temp)
Parameters
The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle.
The contact filter used to filter the results differently, such as by layer mask, Z depth, or normal angle.
Returns
Type | Description |
|---|---|
| ColliderArray2D | A collection of Collider2D containing the results. The collection does not allocate any managed memory but must be disposed of. |