# Introduction to collision in 2D Physics Core

> Understand how 2D Physics Core objects collide, including collision types, contact filters, and layers.

Understand how 2D Physics Core objects collide, including collision types, contact filters, and layers.

> **Note:**
>
> This documentation is about using Pose, Area, and Constraint components. To use 2D physics in the Unity Editor using components like the Rigidbody 2D component, refer to [2D physics](/engine/6000.7/manual/unity2d/2d-physics.md.md) instead.

A collision happens when two objects occupy the same physical space.

To detect a collision, Unity uses the shapes that the Physics Area components on a GameObject create. A Physics Area component is the 2D Physics Core equivalent of a Collider 2D component in the [standard 2D physics system](/engine/6000.7/manual/unity2d/2d-physics.md), and stores a [`PhysicsShape`](/engine/6000.7/script-reference/unity/u2d/physics/physicsshape.md) object.

Shapes don't need to be the same shape as the body, and you can add multiple shapes to one body.

For more information about the available area types, refer to [Physics Pose and Physics Area components](/engine/6000.7/manual/unity2d/2d-physics-api/create-objects/pose-and-area.md).

## Colliding and non-colliding objects

How a shape reacts to a collision depends on the **Is Trigger** property of its Physics Area component.

* **Is Trigger** enabled: The shape is a trigger shape and goes through other objects. When the shape enters another shape, it reports a trigger event.
* **Is Trigger** disabled: The shape is a collider shape and can't enter other objects. When the shape makes contact with another shape, it reports a contact event. This is the default.

Trigger shapes have the following limitations:

* A trigger shape doesn't detect other trigger shapes.
* A trigger shape doesn't use continuous collision detection, so a fast-moving shape might pass through it undetected.

## Contact filters and layers

Each area has a contact filter, which determines the other areas it collides with. A contact filter has the following properties:

* **Categories**: The layers the area belongs to.
* **Contacts**: The layers the area collides with.
* **Group Index**: A group that overrides or filters **Categories** and **Contacts**.

For more information, refer to [Configure collisions between 2D Physics Core objects](/engine/6000.7/manual/unity2d/2d-physics-api/interactions/collisions-enable.md).

By default, layers are the 32 [GameObject layers](/engine/6000.7/manual/working-with-gameobjects/layers.md), and all objects are on the built-in layer called **Default**. 2D Physics Core also provides its own set of 64 layers, which you can use instead of the GameObject layers. For more information, refer to [Set 2D Physics Core to use its own set of layers](/engine/6000.7/manual/unity2d/2d-physics-api/interactions/collisions-enable.md#use-up-to-64-layers).

## Contact event types

All areas can produce events when they overlap or collide with another shape, so you can implement callback methods or update properties.

| **Event type** | **When the event happens**                                                                                                                                                                                                                                                                                 | **Property to enable in an Area component**                                                                         |
| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| Trigger event  | When the area starts and ends overlapping another shape, regardless of whether **Is Trigger** is enabled.                                                                                                                                                                                                  | Enable **Trigger Events**.                                                                                          |
| Contact event  | When the shape starts and ends touching another shape.                                                                                                                                                                                                                                                     | Enable **Contact Events**. This property only has an effect if the area is attached to a kinematic or dynamic pose. |
| Hit events     | When the shape collides faster than the speed set in the **Contact Hit Event Threshold** property of the world. The default is 1 meter per second. For more information, refer to [Physics Simulation Definition asset reference](/engine/6000.7/manual/unity2d/2d-physics-api/worlds/reference-world.md). | Enable **Hit Events**. This property only has an effect if the area is attached to a kinematic or dynamic pose.     |

For more information, refer to [Detect contact between 2D Physics Core objects](/engine/6000.7/manual/unity2d/2d-physics-api/interactions/collision-handle.md).

## Additional resources

* [Configure collisions between 2D Physics Core objects](/engine/6000.7/manual/unity2d/2d-physics-api/interactions/collisions-enable.md)
* [Detect contact between 2D Physics Core objects](/engine/6000.7/manual/unity2d/2d-physics-api/interactions/collision-handle.md)
* [Physics Pose and Physics Area components](/engine/6000.7/manual/unity2d/2d-physics-api/create-objects/pose-and-area.md)
* [Optimize 2D Physics Core with multithreading](/engine/6000.7/manual/unity2d/2d-physics-api/multithreading.md)
