Skip to main content

SceneManager

SceneManager.LoadScene(scenePath) queues a transition using the project- relative source path.

menuScene = "Scenes/main_menu.json"

function Update(gameObjectId, deltaTime)
if Input.GetButtonDown("Pause") then
SceneManager.LoadScene(menuScene)
end
end

Every target must be enabled in Build > Build Settings. The build stages compact disc filenames and resolves the source path through the manifest; Lua continues to use paths such as Scenes/hub.json.

Scene loading releases scene-local GameObjects, Lua state, UI, and component state. Temporary run data can survive through Session; permanent progress belongs in PlayerPrefs or SaveData. Prevent duplicate transition requests in reusable menu scripts, and test the loading display and CD behavior in the packaged CUE.

The call returns a boolean: true means the request was accepted, not that loading finished. Missing destinations and an already pending request return false. An optional second argument selects EntryPoint and Presentation; for example, Presentation Black suppresses the normal loading display. GetEntryPoint exposes the requested marker name in destination Start; your script resolves and uses it. See Session and transitions for option limits, screen fades and a door-transition recipe, and Scene Management for loading settings.