# SetShapeRadius(int, float)

> Sets the radius of a shape.

## Definition

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

```csharp
public void SetShapeRadius(int shapeIndex, float radius)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The index of the shape stored in the [PhysicsShapeGroup2D](/engine/6000.0/script-reference/unityengine/physicsshapegroup2d.md). The shape index is zero-based with the shape group having a quantity of shapes specified by [shapeCount](/engine/6000.0/script-reference/unityengine/physicsshapegroup2d/shapecount.md).**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The value to set the shape radius to.

### 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 shapeIndex = shapeGroup.AddCircle
            (
                center: Vector2.zero,
                radius: 0.5f
            );

        // Fetch the Circle shape and validate the radius.
        var physicsShape = shapeGroup.GetShape(shapeIndex);
        Assert.AreApproximatelyEqual(0.5f, physicsShape.radius);

        // Update the Circle radius.
        shapeGroup.SetShapeRadius(shapeIndex, 2f);

        // Fetch the Circle shape and validate the radius.
        physicsShape = shapeGroup.GetShape(shapeIndex);
        Assert.AreApproximatelyEqual(2f, physicsShape.radius);
    }
}
```
