# TryGetOverlay(string, out Overlay)

> Get an Overlay with matching ID from an EditorWindow canvas.

## Definition

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

## TryGetOverlay(string, Overlay)

```csharp
public bool TryGetOverlay(string id, out Overlay match)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): ID of the overlay to retrieve.**** (\[Overlay]\(/engine/6000.7/script-reference/unityeditor/overlays/overlay)): Contains the overlay with matching id, or null if no matching overlay was found.

### Returns

| Type                                                          | Description                                             |
| ------------------------------------------------------------- | ------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Returns true if the overlay was found, false otherwise. |
