# SetHitEvents(bool)

> Enable/disable hit events on all shapes attached to the body. See _hitEvents.

## Definition

* **Type:** Method
* **Namespace:** [Unity.U2D.Physics](/engine/6000.6/script-reference/unity/u2d/physics.md)
* **Assembly:** UnityEngine.PhysicsCore2DModule

```csharp
public void SetHitEvents(bool hitEvents)
```

### Parameters

**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Whether hit events are allowed on all shapes attached to this body or not.
