# SnapScaleValue

> Rounds the scale value to the closest snapping multiple if scale snapping is active (refer to EditorSnapSettings.scaleSnapEnabled ).

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.7/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule

## SnapScaleValue(float)

Rounds the scale `value` to the closest snapping multiple if scale snapping is active (refer to [EditorSnapSettings.scaleSnapEnabled](/engine/6000.7/script-reference/unityeditor/editorsnapsettings/scalesnapenabled.md)).

```csharp
public static float SnapScaleValue(float value)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The scale value to snap.

### Returns

| Type                                                          | Description                                                                                                                                                                                                                                                                                                                                                                                 |
| ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [float](https://learn.microsoft.com/dotnet/api/system.single) | If [EditorSnapSettings.scaleSnapEnabled](/engine/6000.7/script-reference/unityeditor/editorsnapsettings/scalesnapenabled.md) is enabled, rounds `value` to the closest multiple of `snap` (snap can only be positive), or to the closest multiple of [EditorSnapSettings.scale](/engine/6000.7/script-reference/unityeditor/editorsnapsettings/scale.md) when no `snap` value is specified. |

### Remarks

This method directly uses the value specified by [EditorSnapSettings.scale](/engine/6000.7/script-reference/unityeditor/editorsnapsettings/scale.md) to round `value`. If you want to use a custom snap value, use the additional `snap` parameter. Note that snap can only be positive.

## SnapScaleValue(float, float)

Rounds the scale `value` to the closest snapping multiple if scale snapping is active (refer to [EditorSnapSettings.scaleSnapEnabled](/engine/6000.7/script-reference/unityeditor/editorsnapsettings/scalesnapenabled.md)).

```csharp
public static float SnapScaleValue(float value, float snap)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The scale value to snap.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): A custom scale increment to snap to.

### Returns

| Type                                                          | Description                                                                                                                                                                                                                                                                                                                                                                                 |
| ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [float](https://learn.microsoft.com/dotnet/api/system.single) | If [EditorSnapSettings.scaleSnapEnabled](/engine/6000.7/script-reference/unityeditor/editorsnapsettings/scalesnapenabled.md) is enabled, rounds `value` to the closest multiple of `snap` (snap can only be positive), or to the closest multiple of [EditorSnapSettings.scale](/engine/6000.7/script-reference/unityeditor/editorsnapsettings/scale.md) when no `snap` value is specified. |

### Remarks

This method directly uses the value specified by [EditorSnapSettings.scale](/engine/6000.7/script-reference/unityeditor/editorsnapsettings/scale.md) to round `value`. If you want to use a custom snap value, use the additional `snap` parameter. Note that snap can only be positive.
