# Validate()

> Repair the capsule so that it can be used.

## Definition

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

```csharp
public readonly CapsuleGeometry Validate()
```

### Returns

| Type                                                                                    | Description                                                                                                          |
| --------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| [CapsuleGeometry](/engine/6000.7/script-reference/unity/u2d/physics/capsulegeometry.md) | The repaired capsule. See [\_isValid](/engine/6000.7/script-reference/unity/u2d/physics/capsulegeometry/isvalid.md). |

### Remarks

The radius is clamped to zero or greater. When the two centers are further apart than [\_minEdgeLength](/engine/6000.7/script-reference/unity/u2d/physics/physicsworld/minedgelength.md) they are left as they are, otherwise both are replaced with the shortest axis that can still be used. That replacement keeps the direction between the two centers, or points up when they are identical, because a capsule with no length would behave as a circle instead. It does not preserve the original position: a capsule repaired this way is centered on the origin. A non-finite center or radius is not always repaired and can be returned unchanged, so check [\_isValid](/engine/6000.7/script-reference/unity/u2d/physics/capsulegeometry/isvalid.md) when those values might not be finite.
