# SetActiveTool

> Sets the active EditorTool.

## Definition

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

## SetActiveTool\<T>()

Sets the active [EditorTool](/engine/6000.7/script-reference/unityeditor/editortools/editortool.md).

```csharp
public static void SetActiveTool<T>() where T : EditorTool
```

### Remarks

To set a built-in tool, such as Move, Rotate, or Scale, to active, use [Tools.current](/engine/6000.7/script-reference/unityeditor/tools/current.md) instead.

### Examples

```csharp
using UnityEditor;
using UnityEditor.EditorTools;
using UnityEngine;

class ToolToSetActive : EditorTool
{
    [MenuItem("Tools/Set Active Tool Type")]
    static void SetActiveToolExample()
    {
        ToolManager.SetActiveTool<ToolToSetActive>();
    }

    Vector3 m_Position;

    public override void OnToolGUI(EditorWindow window)
    {
        m_Position = Handles.PositionHandle(m_Position, Quaternion.identity);
        Debug.Log(m_Position);
    }
}
```

## SetActiveTool(Type)

Sets the active [EditorTool](/engine/6000.7/script-reference/unityeditor/editortools/editortool.md).

```csharp
public static void SetActiveTool(Type type)
```

### Parameters

**** (\[Type]\(https\://learn.microsoft.com/dotnet/api/system.type)): The [EditorTool](/engine/6000.7/script-reference/unityeditor/editortools/editortool.md) type to set as the active tool.

### Remarks

To set a built-in tool, such as Move, Rotate, or Scale, to active, use [Tools.current](/engine/6000.7/script-reference/unityeditor/tools/current.md) instead.

### Examples

```csharp
using UnityEditor;
using UnityEditor.EditorTools;
using UnityEngine;

class ToolToSetActive : EditorTool
{
    [MenuItem("Tools/Set Active Tool Type")]
    static void SetActiveToolExample()
    {
        ToolManager.SetActiveTool<ToolToSetActive>();
    }

    Vector3 m_Position;

    public override void OnToolGUI(EditorWindow window)
    {
        m_Position = Handles.PositionHandle(m_Position, Quaternion.identity);
        Debug.Log(m_Position);
    }
}
```

## SetActiveTool(EditorTool)

Sets the active [EditorTool](/engine/6000.7/script-reference/unityeditor/editortools/editortool.md).

```csharp
public static void SetActiveTool(EditorTool tool)
```

### Parameters

**** (\[EditorTool]\(/engine/6000.7/script-reference/unityeditor/editortools/editortool)): The [EditorTool](/engine/6000.7/script-reference/unityeditor/editortools/editortool.md) instance to set as the active tool.

### Remarks

To set a built-in tool, such as Move, Rotate, or Scale, to active, use [Tools.current](/engine/6000.7/script-reference/unityeditor/tools/current.md) instead.

### Examples

```csharp
using UnityEditor;
using UnityEditor.EditorTools;
using UnityEngine;

class ToolToSetActive : EditorTool
{
    [MenuItem("Tools/Set Active Tool Type")]
    static void SetActiveToolExample()
    {
        ToolManager.SetActiveTool<ToolToSetActive>();
    }

    Vector3 m_Position;

    public override void OnToolGUI(EditorWindow window)
    {
        m_Position = Handles.PositionHandle(m_Position, Quaternion.identity);
        Debug.Log(m_Position);
    }
}
```
