# LoadLevelAsync

> Loads the level asynchronously in the background.

## Definition

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

## LoadLevelAsync(int)

Loads the level asynchronously in the background.

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

```csharp
public static AsyncOperation LoadLevelAsync(int index)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)):&#x20;

### Returns

| Type                                                                            | Description |
| ------------------------------------------------------------------------------- | ----------- |
| [AsyncOperation](/engine/6000.7/script-reference/unityengine/asyncoperation.md) |             |

### Remarks

Unity will completely load all assets and all objects in the Scene in a background loading thread. This allows you to load new levels while still playing the current one, show a progress bar or create a completely streaming world where you constantly load and unload different parts of the world based on the player position, without any hiccups in game play.

[AsyncOperation.isDone](/engine/6000.7/script-reference/unityengine/asyncoperation/isdone.md) variable from the resulting [AsyncOperation](/engine/6000.7/script-reference/unityengine/asyncoperation.md) can be used to query if the level load has completed. The result of a LoadLevelAsync can also be used to **yield** in a coroutine.

When building a player Unity automatically optimizes assets in such a way that LoadLevelAsync will load them from disk linearly to avoid seek times.  Note that background loading performance in the Unity Editor is much lower than in the standalone build. In the Editor you might also get more loading hiccups than in the player.

Refer to [Order of execution for event functions](/engine/6000.7/manual/scripting/managing-update-order/execution-order.md) for more information regarding the calling sequence once a level is loaded. Additional Resources: [AsyncOperation](/engine/6000.7/script-reference/unityengine/asyncoperation.md), [Application.backgroundLoadingPriority](/engine/6000.7/script-reference/unityengine/application/backgroundloadingpriority.md), [Application.LoadLevel](/engine/6000.7/script-reference/unityengine/application/loadlevel.md), [Application.LoadLevelAdditive](/engine/6000.7/script-reference/unityengine/application/loadleveladditive.md), [Application.LoadLevelAdditiveAsync](/engine/6000.7/script-reference/unityengine/application/loadleveladditiveasync.md).

## LoadLevelAsync(string)

Loads the level asynchronously in the background.

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

```csharp
public static AsyncOperation LoadLevelAsync(string levelName)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)):&#x20;

### Returns

| Type                                                                            | Description |
| ------------------------------------------------------------------------------- | ----------- |
| [AsyncOperation](/engine/6000.7/script-reference/unityengine/asyncoperation.md) |             |

### Remarks

Unity will completely load all assets and all objects in the Scene in a background loading thread. This allows you to load new levels while still playing the current one, show a progress bar or create a completely streaming world where you constantly load and unload different parts of the world based on the player position, without any hiccups in game play.

[AsyncOperation.isDone](/engine/6000.7/script-reference/unityengine/asyncoperation/isdone.md) variable from the resulting [AsyncOperation](/engine/6000.7/script-reference/unityengine/asyncoperation.md) can be used to query if the level load has completed. The result of a LoadLevelAsync can also be used to **yield** in a coroutine.

When building a player Unity automatically optimizes assets in such a way that LoadLevelAsync will load them from disk linearly to avoid seek times.  Note that background loading performance in the Unity Editor is much lower than in the standalone build. In the Editor you might also get more loading hiccups than in the player.

Refer to [Order of execution for event functions](/engine/6000.7/manual/scripting/managing-update-order/execution-order.md) for more information regarding the calling sequence once a level is loaded. Additional Resources: [AsyncOperation](/engine/6000.7/script-reference/unityengine/asyncoperation.md), [Application.backgroundLoadingPriority](/engine/6000.7/script-reference/unityengine/application/backgroundloadingpriority.md), [Application.LoadLevel](/engine/6000.7/script-reference/unityengine/application/loadlevel.md), [Application.LoadLevelAdditive](/engine/6000.7/script-reference/unityengine/application/loadleveladditive.md), [Application.LoadLevelAdditiveAsync](/engine/6000.7/script-reference/unityengine/application/loadleveladditiveasync.md).
