# CanStreamedLevelBeLoaded

> Checks if the built scene can be loaded.

## Definition

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

## CanStreamedLevelBeLoaded(int)

Checks if the built scene can be loaded.

```csharp
public static bool CanStreamedLevelBeLoaded(int levelIndex)
```

### Parameters

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

### Returns

| Type                                                          | Description |
| ------------------------------------------------------------- | ----------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) |             |

### Remarks

Test if a scene with the provided index exists in the Player build. Returns true if the index value is greater than or equal to zero, and less than [SceneManager.sceneCountInBuildSettings](/engine/6000.7/script-reference/unityengine/scenemanagement/scenemanager/scenecountinbuildsettings.md).

### Examples

```csharp
// Check if level at index 1 can be loaded.
// If it can be loaded then load it.
using System;
using UnityEngine;

public class SampleBehaviour : MonoBehaviour
{
    void Start()
    {
        if (Application.CanStreamedLevelBeLoaded(1))
        {
            Application.LoadLevel(1);
        }
    }
}
```

## CanStreamedLevelBeLoaded(string)

Checks if the built scene can be loaded.

```csharp
public static bool CanStreamedLevelBeLoaded(string levelName)
```

### Parameters

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

### Returns

| Type                                                          | Description |
| ------------------------------------------------------------- | ----------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) |             |

### Remarks

Verify if the named scene exists in either the Player build or currently loaded AssetBundles.

Additional Resources: [SceneManager](/engine/6000.7/script-reference/unityengine/scenemanagement/scenemanager.md)

### Examples

```csharp
// Check if "Level1" can be loaded, if it can be loaded then load it.
using System;
using UnityEngine;

public class SampleBehaviour : MonoBehaviour
{
    void Start()
    {
        if (Application.CanStreamedLevelBeLoaded("Level1"))
        {
            Application.LoadLevel("Level1");
        }
    }
}
```
