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. Persistent 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.

See Scene Management.