# UnloadLevel

> Unloads all GameObject associated with the given Scene. Assets are currently not unloaded to free up asset memory call Resources.UnloadAllUnusedAssets.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

## UnloadLevel(int)

Unloads all GameObject associated with the given Scene. Assets are currently not unloaded to free up asset memory call `Resources.UnloadAllUnusedAssets`.

> **Warning:**
>
> **Deprecated.** Use SceneManager.UnloadScene

```csharp
public static bool UnloadLevel(int index)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Index of the Scene in the PlayerSettings to unload.

### Returns

| Type                                                          | Description                             |
| ------------------------------------------------------------- | --------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Returns true, if the Scene is unloaded. |

## UnloadLevel(string)

Unloads all GameObject associated with the given Scene. Assets are currently not unloaded to free up asset memory call `Resources.UnloadAllUnusedAssets`.

> **Warning:**
>
> **Deprecated.** Use SceneManager.UnloadScene

```csharp
public static bool UnloadLevel(string scenePath)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Name of the Scene to Unload.

### Returns

| Type                                                          | Description                             |
| ------------------------------------------------------------- | --------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Returns true, if the Scene is unloaded. |
