# PhysicsCallbacks.IPreContactCallback

> An interface that when implemented, is called as a contact between a pair of shapes is updated, before the contact is solved. The callback receives the full contact manifold and may modify it, or cancel the contact by calling Cancel on the event.

## Definition

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

```csharp
public interface PhysicsCallbacks.IPreContactCallback
```

## Remarks

This is only called if the [PhysicsWorld](/engine/6000.7/script-reference/unity/u2d/physics/physicsworld.md) and one of the [PhysicsShape](/engine/6000.7/script-reference/unity/u2d/physics/physicsshape.md) both have their `preContactCallbacks` set to true. It takes priority over the deprecated IPreSolveCallback, which is only used when this interface is not implemented on the same target.

## Methods

| Method                                                                                                                     | Description                                                                                                                                                                                                                                                                                                                                                                       |
| -------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [OnPreContact2D](/engine/6000.7/script-reference/unity/u2d/physics/physicscallbacks/iprecontactcallback/onprecontact2d.md) | Called when a contact between a pair of shapes is updated, giving the opportunity to modify the contact manifold before it is solved. Any change written to the manifold is used by the solver this step, and calling Cancel on the event cancels the contact. Modifying the world-space contact points or the point identifiers has no effect, as the solver does not read them. |
