# DrawOutline

> Draws an outline around the specified GameObjects in the Scene View.

## Definition

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

## DrawOutline(int\[], int\[], Color, Color, float)

Draws an outline around the specified GameObjects in the Scene View.

> **Warning:**
>
> **Deprecated.** Deprecated. Use DrawOutline(EntityId\[], EntityId\[], Color, Color, float) instead.

```csharp
public static void DrawOutline(int[] parentRenderers, int[] childRenderers, Color parentNodeColor, Color childNodeColor, float fillOpacity = 0)
```

### Parameters

**** (\[int\[]]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The instance IDs of the first set of Renderers. If you provide GameObjects or Renderers as parameters, these Renderers belong to the GameObjects provided explicitly in the parameters.**** (\[int\[]]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The instance IDs of the second set of Renderers. If you provide GameObjects or Renderers as parameters, these Renderers belong to the child GameObjects of the objects provided in the parameters.**** (\[Color]\(/engine/6000.3/script-reference/unityengine/color)): The color of the outline of the GameObjects provided explicitly in the `objects` parameter and the `parentRenderers` parameters. The alpha value controls the intensity of the outline.**** (\[Color]\(/engine/6000.3/script-reference/unityengine/color)): The color of the outline of the GameObjects which are children to the GameObjects in the `objects` parameter. The alpha value controls the intensity of the outline.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The opacity of the Renderers within each outline.

### Remarks

This only applies to GameObjects that have Renderer components. You can only use this during a [EventType.Repaint](/engine/6000.3/script-reference/unityengine/eventtype/repaint.md) event.

Instead of passing in GameObjects or Renderers, you can also use Renderer [instance IDs](/engine/6000.3/script-reference/unityengine/object/getinstanceid.md). This improves performance because Unity doesn't need to get the instance IDs from the GameObjects or Renderers every time you call this function.

NOTE: Overloads that take GameObject\[], Renderer\[] or List\\\<GameObject\\> as arguments are there for convenience, using them might result in additional allocations that cause additional garbage collection. To avoid performance or memory issues, use these overloads only when drawing a relatively small number of outlines (consider providing renderer instance IDs directly if the number of outlines exceeds 100).

The alpha values of `parentNodeColor` and `childNodeColor` control the intensity of the outline, 0 makes it completely transparent and 1 makes it fully opaque.

The `fillOpacity` controls the weight of the color multiplier for the Renderer. Higher `fillOpacity` values make the color more intense and leave the original object less visible.

Additional Resources: [Handles.DrawCamera](/engine/6000.3/script-reference/unityeditor/handles/drawcamera.md).

### Examples

```csharp
using UnityEditor;
using UnityEngine;

namespace UnityEditor
{
    [CustomEditor(typeof(GameObject))]
    public class CustomInspector : Editor
    {
        private GameObject[] objects;

        public void OnEnable()
        {
            // Note: If you use FindGameObjectsWithTag in a Prefab Stage that you opened from a Scene,
            // it includes GameObjects from that Scene. Instead use:
            // var renderers = StageUtility.GetCurrentStage().FindComponentsOfType<Renderer>();
            // to explicitly specify where to get the GameObjects from.
            objects = GameObject.FindGameObjectsWithTag("Player");  // populate the objects array with game objects
        }

        public void OnSceneGUI()
        {
            // draw the outline with an alpha of 0.5
            if (Event.current.type == EventType.Repaint)
                Handles.DrawOutline(objects, Color.yellow, Color.green, 0.1f);
        }
    }
}
```

## DrawOutline(EntityId\[], EntityId\[], Color, Color, float)

Draws an outline around the specified GameObjects in the Scene View.

```csharp
public static void DrawOutline(EntityId[] parentRenderers, EntityId[] childRenderers, Color parentNodeColor, Color childNodeColor, float fillOpacity = 0)
```

### Parameters

**** (\[EntityId\[]]\(/engine/6000.3/script-reference/unityengine/entityid)): The instance IDs of the first set of Renderers. If you provide GameObjects or Renderers as parameters, these Renderers belong to the GameObjects provided explicitly in the parameters.**** (\[EntityId\[]]\(/engine/6000.3/script-reference/unityengine/entityid)): The instance IDs of the second set of Renderers. If you provide GameObjects or Renderers as parameters, these Renderers belong to the child GameObjects of the objects provided in the parameters.**** (\[Color]\(/engine/6000.3/script-reference/unityengine/color)): The color of the outline of the GameObjects provided explicitly in the `objects` parameter and the `parentRenderers` parameters. The alpha value controls the intensity of the outline.**** (\[Color]\(/engine/6000.3/script-reference/unityengine/color)): The color of the outline of the GameObjects which are children to the GameObjects in the `objects` parameter. The alpha value controls the intensity of the outline.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The opacity of the Renderers within each outline.

### Remarks

This only applies to GameObjects that have Renderer components. You can only use this during a [EventType.Repaint](/engine/6000.3/script-reference/unityengine/eventtype/repaint.md) event.

Instead of passing in GameObjects or Renderers, you can also use Renderer [instance IDs](/engine/6000.3/script-reference/unityengine/object/getinstanceid.md). This improves performance because Unity doesn't need to get the instance IDs from the GameObjects or Renderers every time you call this function.

NOTE: Overloads that take GameObject\[], Renderer\[] or List\\\<GameObject\\> as arguments are there for convenience, using them might result in additional allocations that cause additional garbage collection. To avoid performance or memory issues, use these overloads only when drawing a relatively small number of outlines (consider providing renderer instance IDs directly if the number of outlines exceeds 100).

The alpha values of `parentNodeColor` and `childNodeColor` control the intensity of the outline, 0 makes it completely transparent and 1 makes it fully opaque.

The `fillOpacity` controls the weight of the color multiplier for the Renderer. Higher `fillOpacity` values make the color more intense and leave the original object less visible.

Additional Resources: [Handles.DrawCamera](/engine/6000.3/script-reference/unityeditor/handles/drawcamera.md).

### Examples

```csharp
using UnityEditor;
using UnityEngine;

namespace UnityEditor
{
    [CustomEditor(typeof(GameObject))]
    public class CustomInspector : Editor
    {
        private GameObject[] objects;

        public void OnEnable()
        {
            // Note: If you use FindGameObjectsWithTag in a Prefab Stage that you opened from a Scene,
            // it includes GameObjects from that Scene. Instead use:
            // var renderers = StageUtility.GetCurrentStage().FindComponentsOfType<Renderer>();
            // to explicitly specify where to get the GameObjects from.
            objects = GameObject.FindGameObjectsWithTag("Player");  // populate the objects array with game objects
        }

        public void OnSceneGUI()
        {
            // draw the outline with an alpha of 0.5
            if (Event.current.type == EventType.Repaint)
                Handles.DrawOutline(objects, Color.yellow, Color.green, 0.1f);
        }
    }
}
```

## DrawOutline(int\[], Color, float)

Draws an outline around the specified GameObjects in the Scene View.

> **Warning:**
>
> **Deprecated.** Deprecated. Use DrawOutline(EntityId\[], Color, float) instead.

```csharp
public static void DrawOutline(int[] renderers, Color color, float fillOpacity = 0)
```

### Parameters

**** (\[int\[]]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The Renderers to outline.**** (\[Color]\(/engine/6000.3/script-reference/unityengine/color)): The color of the outline for the `objects` and `renderers`.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The opacity of the Renderers within each outline.

### Remarks

This only applies to GameObjects that have Renderer components. You can only use this during a [EventType.Repaint](/engine/6000.3/script-reference/unityengine/eventtype/repaint.md) event.

Instead of passing in GameObjects or Renderers, you can also use Renderer [instance IDs](/engine/6000.3/script-reference/unityengine/object/getinstanceid.md). This improves performance because Unity doesn't need to get the instance IDs from the GameObjects or Renderers every time you call this function.

NOTE: Overloads that take GameObject\[], Renderer\[] or List\\\<GameObject\\> as arguments are there for convenience, using them might result in additional allocations that cause additional garbage collection. To avoid performance or memory issues, use these overloads only when drawing a relatively small number of outlines (consider providing renderer instance IDs directly if the number of outlines exceeds 100).

The alpha values of `parentNodeColor` and `childNodeColor` control the intensity of the outline, 0 makes it completely transparent and 1 makes it fully opaque.

The `fillOpacity` controls the weight of the color multiplier for the Renderer. Higher `fillOpacity` values make the color more intense and leave the original object less visible.

Additional Resources: [Handles.DrawCamera](/engine/6000.3/script-reference/unityeditor/handles/drawcamera.md).

### Examples

```csharp
using UnityEditor;
using UnityEngine;

namespace UnityEditor
{
    [CustomEditor(typeof(GameObject))]
    public class CustomInspector : Editor
    {
        private GameObject[] objects;

        public void OnEnable()
        {
            // Note: If you use FindGameObjectsWithTag in a Prefab Stage that you opened from a Scene,
            // it includes GameObjects from that Scene. Instead use:
            // var renderers = StageUtility.GetCurrentStage().FindComponentsOfType<Renderer>();
            // to explicitly specify where to get the GameObjects from.
            objects = GameObject.FindGameObjectsWithTag("Player");  // populate the objects array with game objects
        }

        public void OnSceneGUI()
        {
            // draw the outline with an alpha of 0.5
            if (Event.current.type == EventType.Repaint)
                Handles.DrawOutline(objects, Color.yellow, Color.green, 0.1f);
        }
    }
}
```

## DrawOutline(EntityId\[], Color, float)

Draws an outline around the specified GameObjects in the Scene View.

```csharp
public static void DrawOutline(EntityId[] renderers, Color color, float fillOpacity = 0)
```

### Parameters

**** (\[EntityId\[]]\(/engine/6000.3/script-reference/unityengine/entityid)): The Renderers to outline.**** (\[Color]\(/engine/6000.3/script-reference/unityengine/color)): The color of the outline for the `objects` and `renderers`.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The opacity of the Renderers within each outline.

### Remarks

This only applies to GameObjects that have Renderer components. You can only use this during a [EventType.Repaint](/engine/6000.3/script-reference/unityengine/eventtype/repaint.md) event.

Instead of passing in GameObjects or Renderers, you can also use Renderer [instance IDs](/engine/6000.3/script-reference/unityengine/object/getinstanceid.md). This improves performance because Unity doesn't need to get the instance IDs from the GameObjects or Renderers every time you call this function.

NOTE: Overloads that take GameObject\[], Renderer\[] or List\\\<GameObject\\> as arguments are there for convenience, using them might result in additional allocations that cause additional garbage collection. To avoid performance or memory issues, use these overloads only when drawing a relatively small number of outlines (consider providing renderer instance IDs directly if the number of outlines exceeds 100).

The alpha values of `parentNodeColor` and `childNodeColor` control the intensity of the outline, 0 makes it completely transparent and 1 makes it fully opaque.

The `fillOpacity` controls the weight of the color multiplier for the Renderer. Higher `fillOpacity` values make the color more intense and leave the original object less visible.

Additional Resources: [Handles.DrawCamera](/engine/6000.3/script-reference/unityeditor/handles/drawcamera.md).

### Examples

```csharp
using UnityEditor;
using UnityEngine;

namespace UnityEditor
{
    [CustomEditor(typeof(GameObject))]
    public class CustomInspector : Editor
    {
        private GameObject[] objects;

        public void OnEnable()
        {
            // Note: If you use FindGameObjectsWithTag in a Prefab Stage that you opened from a Scene,
            // it includes GameObjects from that Scene. Instead use:
            // var renderers = StageUtility.GetCurrentStage().FindComponentsOfType<Renderer>();
            // to explicitly specify where to get the GameObjects from.
            objects = GameObject.FindGameObjectsWithTag("Player");  // populate the objects array with game objects
        }

        public void OnSceneGUI()
        {
            // draw the outline with an alpha of 0.5
            if (Event.current.type == EventType.Repaint)
                Handles.DrawOutline(objects, Color.yellow, Color.green, 0.1f);
        }
    }
}
```

## DrawOutline(Renderer\[], Color, Color, float)

Draws an outline around the specified GameObjects in the Scene View.

```csharp
public static void DrawOutline(Renderer[] renderers, Color parentNodeColor, Color childNodeColor, float fillOpacity = 0)
```

### Parameters

**** (\[Renderer\[]]\(/engine/6000.3/script-reference/unityengine/renderer)): The Renderers to outline.**** (\[Color]\(/engine/6000.3/script-reference/unityengine/color)): The color of the outline of the GameObjects provided explicitly in the `objects` parameter and the `parentRenderers` parameters. The alpha value controls the intensity of the outline.**** (\[Color]\(/engine/6000.3/script-reference/unityengine/color)): The color of the outline of the GameObjects which are children to the GameObjects in the `objects` parameter. The alpha value controls the intensity of the outline.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The opacity of the Renderers within each outline.

### Remarks

This only applies to GameObjects that have Renderer components. You can only use this during a [EventType.Repaint](/engine/6000.3/script-reference/unityengine/eventtype/repaint.md) event.

Instead of passing in GameObjects or Renderers, you can also use Renderer [instance IDs](/engine/6000.3/script-reference/unityengine/object/getinstanceid.md). This improves performance because Unity doesn't need to get the instance IDs from the GameObjects or Renderers every time you call this function.

NOTE: Overloads that take GameObject\[], Renderer\[] or List\\\<GameObject\\> as arguments are there for convenience, using them might result in additional allocations that cause additional garbage collection. To avoid performance or memory issues, use these overloads only when drawing a relatively small number of outlines (consider providing renderer instance IDs directly if the number of outlines exceeds 100).

The alpha values of `parentNodeColor` and `childNodeColor` control the intensity of the outline, 0 makes it completely transparent and 1 makes it fully opaque.

The `fillOpacity` controls the weight of the color multiplier for the Renderer. Higher `fillOpacity` values make the color more intense and leave the original object less visible.

Additional Resources: [Handles.DrawCamera](/engine/6000.3/script-reference/unityeditor/handles/drawcamera.md).

### Examples

```csharp
using UnityEditor;
using UnityEngine;

namespace UnityEditor
{
    [CustomEditor(typeof(GameObject))]
    public class CustomInspector : Editor
    {
        private GameObject[] objects;

        public void OnEnable()
        {
            // Note: If you use FindGameObjectsWithTag in a Prefab Stage that you opened from a Scene,
            // it includes GameObjects from that Scene. Instead use:
            // var renderers = StageUtility.GetCurrentStage().FindComponentsOfType<Renderer>();
            // to explicitly specify where to get the GameObjects from.
            objects = GameObject.FindGameObjectsWithTag("Player");  // populate the objects array with game objects
        }

        public void OnSceneGUI()
        {
            // draw the outline with an alpha of 0.5
            if (Event.current.type == EventType.Repaint)
                Handles.DrawOutline(objects, Color.yellow, Color.green, 0.1f);
        }
    }
}
```

## DrawOutline(Renderer\[], Color, float)

Draws an outline around the specified GameObjects in the Scene View.

```csharp
public static void DrawOutline(Renderer[] renderers, Color color, float fillOpacity = 0)
```

### Parameters

**** (\[Renderer\[]]\(/engine/6000.3/script-reference/unityengine/renderer)): The Renderers to outline.**** (\[Color]\(/engine/6000.3/script-reference/unityengine/color)): The color of the outline for the `objects` and `renderers`.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The opacity of the Renderers within each outline.

### Remarks

This only applies to GameObjects that have Renderer components. You can only use this during a [EventType.Repaint](/engine/6000.3/script-reference/unityengine/eventtype/repaint.md) event.

Instead of passing in GameObjects or Renderers, you can also use Renderer [instance IDs](/engine/6000.3/script-reference/unityengine/object/getinstanceid.md). This improves performance because Unity doesn't need to get the instance IDs from the GameObjects or Renderers every time you call this function.

NOTE: Overloads that take GameObject\[], Renderer\[] or List\\\<GameObject\\> as arguments are there for convenience, using them might result in additional allocations that cause additional garbage collection. To avoid performance or memory issues, use these overloads only when drawing a relatively small number of outlines (consider providing renderer instance IDs directly if the number of outlines exceeds 100).

The alpha values of `parentNodeColor` and `childNodeColor` control the intensity of the outline, 0 makes it completely transparent and 1 makes it fully opaque.

The `fillOpacity` controls the weight of the color multiplier for the Renderer. Higher `fillOpacity` values make the color more intense and leave the original object less visible.

Additional Resources: [Handles.DrawCamera](/engine/6000.3/script-reference/unityeditor/handles/drawcamera.md).

### Examples

```csharp
using UnityEditor;
using UnityEngine;

namespace UnityEditor
{
    [CustomEditor(typeof(GameObject))]
    public class CustomInspector : Editor
    {
        private GameObject[] objects;

        public void OnEnable()
        {
            // Note: If you use FindGameObjectsWithTag in a Prefab Stage that you opened from a Scene,
            // it includes GameObjects from that Scene. Instead use:
            // var renderers = StageUtility.GetCurrentStage().FindComponentsOfType<Renderer>();
            // to explicitly specify where to get the GameObjects from.
            objects = GameObject.FindGameObjectsWithTag("Player");  // populate the objects array with game objects
        }

        public void OnSceneGUI()
        {
            // draw the outline with an alpha of 0.5
            if (Event.current.type == EventType.Repaint)
                Handles.DrawOutline(objects, Color.yellow, Color.green, 0.1f);
        }
    }
}
```

## DrawOutline(GameObject\[], Color, Color, float)

Draws an outline around the specified GameObjects in the Scene View.

```csharp
public static void DrawOutline(GameObject[] objects, Color parentNodeColor, Color childNodeColor, float fillOpacity = 0)
```

### Parameters

**** (\[GameObject\[]]\(/engine/6000.3/script-reference/unityengine/gameobject)): The GameObjects to outline.**** (\[Color]\(/engine/6000.3/script-reference/unityengine/color)): The color of the outline of the GameObjects provided explicitly in the `objects` parameter and the `parentRenderers` parameters. The alpha value controls the intensity of the outline.**** (\[Color]\(/engine/6000.3/script-reference/unityengine/color)): The color of the outline of the GameObjects which are children to the GameObjects in the `objects` parameter. The alpha value controls the intensity of the outline.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The opacity of the Renderers within each outline.

### Remarks

This only applies to GameObjects that have Renderer components. You can only use this during a [EventType.Repaint](/engine/6000.3/script-reference/unityengine/eventtype/repaint.md) event.

Instead of passing in GameObjects or Renderers, you can also use Renderer [instance IDs](/engine/6000.3/script-reference/unityengine/object/getinstanceid.md). This improves performance because Unity doesn't need to get the instance IDs from the GameObjects or Renderers every time you call this function.

NOTE: Overloads that take GameObject\[], Renderer\[] or List\\\<GameObject\\> as arguments are there for convenience, using them might result in additional allocations that cause additional garbage collection. To avoid performance or memory issues, use these overloads only when drawing a relatively small number of outlines (consider providing renderer instance IDs directly if the number of outlines exceeds 100).

The alpha values of `parentNodeColor` and `childNodeColor` control the intensity of the outline, 0 makes it completely transparent and 1 makes it fully opaque.

The `fillOpacity` controls the weight of the color multiplier for the Renderer. Higher `fillOpacity` values make the color more intense and leave the original object less visible.

Additional Resources: [Handles.DrawCamera](/engine/6000.3/script-reference/unityeditor/handles/drawcamera.md).

### Examples

```csharp
using UnityEditor;
using UnityEngine;

namespace UnityEditor
{
    [CustomEditor(typeof(GameObject))]
    public class CustomInspector : Editor
    {
        private GameObject[] objects;

        public void OnEnable()
        {
            // Note: If you use FindGameObjectsWithTag in a Prefab Stage that you opened from a Scene,
            // it includes GameObjects from that Scene. Instead use:
            // var renderers = StageUtility.GetCurrentStage().FindComponentsOfType<Renderer>();
            // to explicitly specify where to get the GameObjects from.
            objects = GameObject.FindGameObjectsWithTag("Player");  // populate the objects array with game objects
        }

        public void OnSceneGUI()
        {
            // draw the outline with an alpha of 0.5
            if (Event.current.type == EventType.Repaint)
                Handles.DrawOutline(objects, Color.yellow, Color.green, 0.1f);
        }
    }
}
```

## DrawOutline(GameObject\[], Color, float)

Draws an outline around the specified GameObjects in the Scene View.

```csharp
public static void DrawOutline(GameObject[] objects, Color color, float fillOpacity = 0)
```

### Parameters

**** (\[GameObject\[]]\(/engine/6000.3/script-reference/unityengine/gameobject)): The GameObjects to outline.**** (\[Color]\(/engine/6000.3/script-reference/unityengine/color)): The color of the outline for the `objects` and `renderers`.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The opacity of the Renderers within each outline.

### Remarks

This only applies to GameObjects that have Renderer components. You can only use this during a [EventType.Repaint](/engine/6000.3/script-reference/unityengine/eventtype/repaint.md) event.

Instead of passing in GameObjects or Renderers, you can also use Renderer [instance IDs](/engine/6000.3/script-reference/unityengine/object/getinstanceid.md). This improves performance because Unity doesn't need to get the instance IDs from the GameObjects or Renderers every time you call this function.

NOTE: Overloads that take GameObject\[], Renderer\[] or List\\\<GameObject\\> as arguments are there for convenience, using them might result in additional allocations that cause additional garbage collection. To avoid performance or memory issues, use these overloads only when drawing a relatively small number of outlines (consider providing renderer instance IDs directly if the number of outlines exceeds 100).

The alpha values of `parentNodeColor` and `childNodeColor` control the intensity of the outline, 0 makes it completely transparent and 1 makes it fully opaque.

The `fillOpacity` controls the weight of the color multiplier for the Renderer. Higher `fillOpacity` values make the color more intense and leave the original object less visible.

Additional Resources: [Handles.DrawCamera](/engine/6000.3/script-reference/unityeditor/handles/drawcamera.md).

### Examples

```csharp
using UnityEditor;
using UnityEngine;

namespace UnityEditor
{
    [CustomEditor(typeof(GameObject))]
    public class CustomInspector : Editor
    {
        private GameObject[] objects;

        public void OnEnable()
        {
            // Note: If you use FindGameObjectsWithTag in a Prefab Stage that you opened from a Scene,
            // it includes GameObjects from that Scene. Instead use:
            // var renderers = StageUtility.GetCurrentStage().FindComponentsOfType<Renderer>();
            // to explicitly specify where to get the GameObjects from.
            objects = GameObject.FindGameObjectsWithTag("Player");  // populate the objects array with game objects
        }

        public void OnSceneGUI()
        {
            // draw the outline with an alpha of 0.5
            if (Event.current.type == EventType.Repaint)
                Handles.DrawOutline(objects, Color.yellow, Color.green, 0.1f);
        }
    }
}
```

## DrawOutline(List\<GameObject>, Color, Color, float)

Draws an outline around the specified GameObjects in the Scene View.

```csharp
public static void DrawOutline(List<GameObject> objects, Color parentNodeColor, Color childNodeColor, float fillOpacity = 0)
```

### Parameters

**** (\[List\<GameObject>]\(https\://learn.microsoft.com/dotnet/api/system.collections.generic.list-1)): The GameObjects to outline.**** (\[Color]\(/engine/6000.3/script-reference/unityengine/color)): The color of the outline of the GameObjects provided explicitly in the `objects` parameter and the `parentRenderers` parameters. The alpha value controls the intensity of the outline.**** (\[Color]\(/engine/6000.3/script-reference/unityengine/color)): The color of the outline of the GameObjects which are children to the GameObjects in the `objects` parameter. The alpha value controls the intensity of the outline.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The opacity of the Renderers within each outline.

### Remarks

This only applies to GameObjects that have Renderer components. You can only use this during a [EventType.Repaint](/engine/6000.3/script-reference/unityengine/eventtype/repaint.md) event.

Instead of passing in GameObjects or Renderers, you can also use Renderer [instance IDs](/engine/6000.3/script-reference/unityengine/object/getinstanceid.md). This improves performance because Unity doesn't need to get the instance IDs from the GameObjects or Renderers every time you call this function.

NOTE: Overloads that take GameObject\[], Renderer\[] or List\\\<GameObject\\> as arguments are there for convenience, using them might result in additional allocations that cause additional garbage collection. To avoid performance or memory issues, use these overloads only when drawing a relatively small number of outlines (consider providing renderer instance IDs directly if the number of outlines exceeds 100).

The alpha values of `parentNodeColor` and `childNodeColor` control the intensity of the outline, 0 makes it completely transparent and 1 makes it fully opaque.

The `fillOpacity` controls the weight of the color multiplier for the Renderer. Higher `fillOpacity` values make the color more intense and leave the original object less visible.

Additional Resources: [Handles.DrawCamera](/engine/6000.3/script-reference/unityeditor/handles/drawcamera.md).

### Examples

```csharp
using UnityEditor;
using UnityEngine;

namespace UnityEditor
{
    [CustomEditor(typeof(GameObject))]
    public class CustomInspector : Editor
    {
        private GameObject[] objects;

        public void OnEnable()
        {
            // Note: If you use FindGameObjectsWithTag in a Prefab Stage that you opened from a Scene,
            // it includes GameObjects from that Scene. Instead use:
            // var renderers = StageUtility.GetCurrentStage().FindComponentsOfType<Renderer>();
            // to explicitly specify where to get the GameObjects from.
            objects = GameObject.FindGameObjectsWithTag("Player");  // populate the objects array with game objects
        }

        public void OnSceneGUI()
        {
            // draw the outline with an alpha of 0.5
            if (Event.current.type == EventType.Repaint)
                Handles.DrawOutline(objects, Color.yellow, Color.green, 0.1f);
        }
    }
}
```

## DrawOutline(List\<GameObject>, Color, float)

Draws an outline around the specified GameObjects in the Scene View.

```csharp
public static void DrawOutline(List<GameObject> objects, Color color, float fillOpacity = 0)
```

### Parameters

**** (\[List\<GameObject>]\(https\://learn.microsoft.com/dotnet/api/system.collections.generic.list-1)): The GameObjects to outline.**** (\[Color]\(/engine/6000.3/script-reference/unityengine/color)): The color of the outline for the `objects` and `renderers`.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The opacity of the Renderers within each outline.

### Remarks

This only applies to GameObjects that have Renderer components. You can only use this during a [EventType.Repaint](/engine/6000.3/script-reference/unityengine/eventtype/repaint.md) event.

Instead of passing in GameObjects or Renderers, you can also use Renderer [instance IDs](/engine/6000.3/script-reference/unityengine/object/getinstanceid.md). This improves performance because Unity doesn't need to get the instance IDs from the GameObjects or Renderers every time you call this function.

NOTE: Overloads that take GameObject\[], Renderer\[] or List\\\<GameObject\\> as arguments are there for convenience, using them might result in additional allocations that cause additional garbage collection. To avoid performance or memory issues, use these overloads only when drawing a relatively small number of outlines (consider providing renderer instance IDs directly if the number of outlines exceeds 100).

The alpha values of `parentNodeColor` and `childNodeColor` control the intensity of the outline, 0 makes it completely transparent and 1 makes it fully opaque.

The `fillOpacity` controls the weight of the color multiplier for the Renderer. Higher `fillOpacity` values make the color more intense and leave the original object less visible.

Additional Resources: [Handles.DrawCamera](/engine/6000.3/script-reference/unityeditor/handles/drawcamera.md).

### Examples

```csharp
using UnityEditor;
using UnityEngine;

namespace UnityEditor
{
    [CustomEditor(typeof(GameObject))]
    public class CustomInspector : Editor
    {
        private GameObject[] objects;

        public void OnEnable()
        {
            // Note: If you use FindGameObjectsWithTag in a Prefab Stage that you opened from a Scene,
            // it includes GameObjects from that Scene. Instead use:
            // var renderers = StageUtility.GetCurrentStage().FindComponentsOfType<Renderer>();
            // to explicitly specify where to get the GameObjects from.
            objects = GameObject.FindGameObjectsWithTag("Player");  // populate the objects array with game objects
        }

        public void OnSceneGUI()
        {
            // draw the outline with an alpha of 0.5
            if (Event.current.type == EventType.Repaint)
                Handles.DrawOutline(objects, Color.yellow, Color.green, 0.1f);
        }
    }
}
```
