> For the complete documentation index, see [llms.txt](https://fish-networking.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fish-networking.gitbook.io/docs/guides/features/scene-management/unloading-scenes.md).

# Unloading Scenes

## General

Unloading scenes is the same as loading scenes, except to call Unload rather than Load. Scenes can be unloaded by connection, or globally. When unloaded globally scenes will be unloaded for all players. When unloading by connection only the connections specified will unload the scenes.

## Unloading scenes

### Global scenes

* **Global Scenes** can be unloaded by calling UnloadGlobalScenes() in the SceneManager.
* You cannot unload a global scene with UnloadConnectionScenes() method.

```csharp
SceneUnloadData sud = new SceneUnloadData("Town");
base.NetworkManager.SceneManager.UnloadGlobalScenes(sud);
```

### Connection scenes

**Connection Scenes** follow the same principle, but has a few method overloads. You can unload scenes for a single connection, multiple connections at once, or unload scenes on the server.

* The Server will only Unload a connection scene on itself, if all connections have been unloaded from that scene.
* If you wish to unload a scene and all connections, get all the connections in the scene and call unload with those connections. SceneManager.SceneConnections holds all online scenes and the connections in them.
* If you wish to keep a scene loaded on server when unloading all Connections See [**Scene Caching**](/docs/guides/features/scene-management/scene-caching.md).

```csharp
SceneUnloadData sud = new SceneUnloadData(new string[] { "Main", "Additive") });

// Unload scenes for a single connection.
NetworkConnection conn = base.Owner;
base.NetworkManager.SceneManager.UnloadConnectionScenes(conn, sud);

// Unload scenes for several connections at once.
NetworkConnection[] conns = new NetworkConnection[] { connA, connB };
base.NetworkManager.SceneManager.UnloadConnectionScenes(conns, sud);

// Unload scenes only on the server.
// that you don't want all players in.
base.NetworkManager.SceneManager.UnloadConnectionScenes(sud);
```

## Advanced info

### Behind the "scenes"

The [**SceneManager**](/docs/fishnet-building-blocks/components/managers/scenemanager.md) Class has very detailed XML comments on how the unload process works in detail, if you need to troubleshoot the scene unload process, these comments will help you understand the flow of how a scene loads.

### Events

Make sure to check out the [**Scene Events**](/docs/guides/features/scene-management/scene-events.md) that you can subscribe to to give better control over your game.
