# SceneLookupData

## General

{% hint style="warning" %}
When Creating [**SceneLoadData**](/docs/guides/features/scene-management/scene-data/sceneloaddata.md) or [**SceneUnloadData**](/docs/guides/features/scene-management/scene-data/sceneunloaddata.md) there are provided constructors that automatically create SceneLookupData for you. Most likely you will be using these constructors and will not be creating a separate SceneLookupData.
{% endhint %}

When you specify a scene by reference, or handle, the SceneManager will prefer to lookup that scene using the scene handle. This is important information when [**Scene Stacking**](/docs/guides/features/scene-management/scene-stacking.md). Looking up a scene by handle or object reference will place connections in the scene specified, but when using scene names, the server will create a new scene instance for the specified connections and place them into that scene. The described behavior only applies when loading scenes over multiple load calls; such as if you call LoadConnectionScene twice, each with its own connection.

## Default values

{% hint style="info" %}
A Scene Handle is an integer that Unity generates for a scene instance when it is loaded. You can use it to specify an instance of a scene that is already loaded, but not for loading a new instance of that scene. Read more about it here: <https://docs.unity3d.com/ScriptReference/SceneManagement.Scene-handle.html>
{% endhint %}

```csharp
// SceneLookupData default values
SceneLookupData slud = new SceneLookupData()
{ 
    // If Handle is greater than 0 then it will ignore Name and use Handle
    // to look up the scene.
    Handle = 0,
    // If Handle is set to 0, then Name is used to lookup the scene instead.
    Name = null 
}; 
```

See[ **Loading Scenes**](/docs/guides/features/scene-management/loading-scenes.md) and [**Unloading Scenes**](/docs/guides/features/scene-management/unloading-scenes.md) for implementation.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://fish-networking.gitbook.io/docs/guides/features/scene-management/scene-data/scenelookupdata.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
