# RangeAttribute(float, float)

> Attribute used to make a float or int variable in a script be restricted to a specific range.

## Definition

* **Type:** Constructor
* **Namespace:** [UnityEngine](/engine/6000.6/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public RangeAttribute(float min, float max)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The minimum allowed value.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The maximum allowed value.

### Remarks

When this attribute is used, the float or int will be shown as a slider in the Inspector instead of the default number field.
