PhysicsShape.ContactFilter
A contact filter is used to control what contacts are created when intersecting other shapes. A contact filter contains a filter with the addition of a group index allowing overrides to the filter.
Read time 1 minuteLast updated 13 days ago
Definition
- Type: Struct
- Namespace: UnityEngine.LowLevelPhysics2D
- Assembly: UnityEngine.Physics2DModule
public struct PhysicsShape.ContactFilter
Static Fields
Value | Description |
|---|---|
| DefaultCategories | The default categories used. |
| DefaultContacts | The default contacts used. |
| defaultFilter | Get a default contact filter that contacts everything. |
| Everything | Get a contact filter that is all categories and contacts everything. |
Constructors
Constructor | Description |
|---|---|
| ContactFilter(UnityEngine.LowLevelPhysics2D.PhysicsMask,UnityEngine.LowLevelPhysics2D.PhysicsMask,System.Int32) | Create a contact filter. |
Properties
Property | Description |
|---|---|
| categories | The categories this object is in. Usually you would only set one bit but multiple are allowed. |
| contacts | The categories this object will produce contacts with. |
| groupIndex | Collision groups allow a certain group of objects to never collide (negative) or always collide (positive). A group index of zero has no effect. A non-zero group always overrides the category/contacts masks. |