# radius

> The radius of the shape.

## Definition

* **Type:** Property
* **Namespace:** [UnityEngine](/engine/6000.7/script-reference/unityengine.md)
* **Assembly:** UnityEngine.Physics2DModule

```csharp
public float radius { get; set; }
```

### Remarks

All [PhysicsShapeType2D](/engine/6000.7/script-reference/unityengine/physicsshapetype2d.md) use this radius with the exception of the [Polygon](/engine/6000.7/script-reference/unityengine/physicsshapetype2d/polygon.md) type. Refer to the individual shape types for details on how the radius is used for the respective shape.

### Examples

```csharp
using UnityEngine;
using UnityEngine.Assertions;

public class Example : MonoBehaviour
{
    void Start()
    {
        // Create a shape group.
        var shapeGroup = new PhysicsShapeGroup2D();

        // Add a Circle to the shape group.
        var circleShapeIndex = shapeGroup.AddCircle
            (
                center: new Vector2(-2f, 3f),
                radius: 1f
            );

        // Add a Capsule to the shape group.
        var capsuleShapeIndex = shapeGroup.AddCapsule
            (
                vertex0: Vector2.down,
                vertex1: Vector2.up,
                radius: 0.5f
            );

        // Fetch the shapes.
        var circleShape = shapeGroup.GetShape(circleShapeIndex);
        var capsuleShape = shapeGroup.GetShape(capsuleShapeIndex);

        // Validate the shape radius.
        Assert.AreApproximatelyEqual(1f, circleShape.radius);
        Assert.AreApproximatelyEqual(0.5f, capsuleShape.radius);
    }
}
```
