Skip to content

Format

typescript
SceneManager.UnloadSceneByName(name)

class: SceneManager

Description

Unloads the scene with the specified name.

After unloading the scene, all game objects, assets, and scripts in the scene will be released, and the scene will be unloaded from memory, freeing up related resources.

Parameters

param_nametypedescription
nameStringThe name of the scene.

Return

typedescription
booleanReturns true if the scene is successfully unloaded.

Code Example

typescript
 const scene = SceneManager.CreateScene("test");    
 SceneManager.UnloadScene("test")