# ScaleHandle

> Make a Scene view scale handle.

## Definition

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

## ScaleHandle(Vector3, Vector3, Quaternion)

Make a Scene view scale handle.

```csharp
public static Vector3 ScaleHandle(Vector3 scale, Vector3 position, Quaternion rotation)
```

### Parameters

**** (\[Vector3]\(/engine/6000.6/script-reference/unityengine/vector3)): Scale to modify.**** (\[Vector3]\(/engine/6000.6/script-reference/unityengine/vector3)): The position of the handle.**** (\[Quaternion]\(/engine/6000.6/script-reference/unityengine/quaternion)): The rotation of the handle.

### Returns

| Type                                                              | Description                                                                                                                                                            |
| ----------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Vector3](/engine/6000.6/script-reference/unityengine/vector3.md) | The new value modified by the user's interaction with the handle. If the user has not moved the handle, it will return the same value as you passed into the function. |

### Remarks

This will behave like the built-in scale tool

**Note:** Use [HandleUtility.GetHandleSize](/engine/6000.6/script-reference/unityeditor/handleutility/gethandlesize.md) where you might want to have constant screen-sized handles.

![ScaleHandle (ScaleHandle)](/api/media?file=/engine/6000.6/media/images/ScaleHandle.png)

*Scale handle that will appear whenever you select the GameObject.*

```csharp
// Name this script "ScaleAtPointEditor"
using UnityEngine;
using UnityEditor;

[CustomEditor(typeof(ScaleAtPoint))]
[CanEditMultipleObjects]
public class ScaleAtPointEditor : Editor
{
    public void OnSceneGUI()
    {
        ScaleAtPoint t = (target as ScaleAtPoint);

        EditorGUI.BeginChangeCheck();
        Vector3 scale = Handles.ScaleHandle(t.scale, Vector3.zero, Quaternion.identity, 1);
        if (EditorGUI.EndChangeCheck())
        {
            Undo.RecordObject(target, "Scaled ScaleAt Point");
            t.scale = scale;
            t.Update();
        }
    }
}
```

And the script Attached to this GameObject:

```csharp
// Name this script "ScaleAtPoint"
using UnityEngine;
[ExecuteInEditMode]
public class ScaleAtPoint : MonoBehaviour
{
    public Vector3 scale = Vector3.one;
    public void Update()
    {
        transform.localScale = scale;
    }
}
```

## ScaleHandle(Vector3, Vector3, Quaternion, float)

Make a Scene view scale handle.

```csharp
public static Vector3 ScaleHandle(Vector3 scale, Vector3 position, Quaternion rotation, float size)
```

### Parameters

**** (\[Vector3]\(/engine/6000.6/script-reference/unityengine/vector3)): Scale to modify.**** (\[Vector3]\(/engine/6000.6/script-reference/unityengine/vector3)): The position of the handle.**** (\[Quaternion]\(/engine/6000.6/script-reference/unityengine/quaternion)): The rotation of the handle.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): Allows you to scale the size of the handle on-screen.

### Returns

| Type                                                              | Description                                                                                                                                                            |
| ----------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Vector3](/engine/6000.6/script-reference/unityengine/vector3.md) | The new value modified by the user's interaction with the handle. If the user has not moved the handle, it will return the same value as you passed into the function. |

### Remarks

This will behave like the built-in scale tool

**Note:** Use [HandleUtility.GetHandleSize](/engine/6000.6/script-reference/unityeditor/handleutility/gethandlesize.md) where you might want to have constant screen-sized handles.

![ScaleHandle (ScaleHandle)](/api/media?file=/engine/6000.6/media/images/ScaleHandle.png)

*Scale handle that will appear whenever you select the GameObject.*

```csharp
// Name this script "ScaleAtPointEditor"
using UnityEngine;
using UnityEditor;

[CustomEditor(typeof(ScaleAtPoint))]
[CanEditMultipleObjects]
public class ScaleAtPointEditor : Editor
{
    public void OnSceneGUI()
    {
        ScaleAtPoint t = (target as ScaleAtPoint);

        EditorGUI.BeginChangeCheck();
        Vector3 scale = Handles.ScaleHandle(t.scale, Vector3.zero, Quaternion.identity, 1);
        if (EditorGUI.EndChangeCheck())
        {
            Undo.RecordObject(target, "Scaled ScaleAt Point");
            t.scale = scale;
            t.Update();
        }
    }
}
```

And the script Attached to this GameObject:

```csharp
// Name this script "ScaleAtPoint"
using UnityEngine;
[ExecuteInEditMode]
public class ScaleAtPoint : MonoBehaviour
{
    public Vector3 scale = Vector3.one;
    public void Update()
    {
        transform.localScale = scale;
    }
}
```
