Code inspection: The index is missing in the build settings
This inspection reports scene-loading calls that use a numeric build index that is outside the range of scenes listed in Unity Build Settings.
This inspection applies to scene-loading APIs such as SceneManager.LoadScene and older index-based scene-loading calls. If the index is too large, Unity will not be able to load the scene at runtime.
Example
In this example, the index 42 is used, which is likely not a valid build index in most projects.
using UnityEngine.SceneManagement;
public class Example
{
public void OpenScene()
{
// Reported: 42 is likely an invalid build index
SceneManager.LoadScene(42);
}
}
using UnityEngine.SceneManagement;
public class Example
{
public void OpenScene()
{
// 1 is a valid build index
SceneManager.LoadScene(1);
}
}
Quick-fix
This inspection does not provide a dedicated quick-fix. Fix the call manually by using a valid build index, or switch to loading by scene name.
26 March 2026