question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

KeyNotFoundException: The given key '89302010' was not present in the dictionary. Network Scene Manager

See original GitHub issue

Description

When my client joins a host the scene loads but the gives the error KeyNotFoundException: The given key '89302010' was not present in the dictionary.

This happened when I updated from 1.0.2 to 1.1.0.

Reproduce Steps

Have a client join a host who is on a different scene than the client

Actual Outcome

Scene was loaded. No network objects spawn. No RPCs get received.

Expected Outcome

Scene should load and network objects should sync.

Environment

  • OS: Windows
  • Unity Version: 2021.3.6f1
  • Netcode Version: 1.1.0

Additional Context

Trace:

KeyNotFoundException: The given key '89302010' was not present in the dictionary.
System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) (at <e40e5a8f982c4b618a930d29f9bd091c>:0)
Unity.Netcode.NetworkSceneManager.GetSceneRelativeInSceneNetworkObject (System.UInt32 globalObjectIdHash, System.Nullable`1[T] networkSceneHandle) (at Library/PackageCache/com.unity.netcode.gameobjects@1.1.0/Runtime/SceneManagement/NetworkSceneManager.cs:755)
Unity.Netcode.NetworkSpawnManager.CreateLocalNetworkObject (Unity.Netcode.NetworkObject+SceneObject sceneObject) (at Library/PackageCache/com.unity.netcode.gameobjects@1.1.0/Runtime/Spawning/NetworkSpawnManager.cs:385)
Unity.Netcode.NetworkObject.AddSceneObject (Unity.Netcode.NetworkObject+SceneObject& sceneObject, Unity.Netcode.FastBufferReader variableData, Unity.Netcode.NetworkManager networkManager) (at Library/PackageCache/com.unity.netcode.gameobjects@1.1.0/Runtime/Core/NetworkObject.cs:1287)
Unity.Netcode.SceneEventData.SynchronizeSceneNetworkObjects (Unity.Netcode.NetworkManager networkManager) (at Library/PackageCache/com.unity.netcode.gameobjects@1.1.0/Runtime/SceneManagement/SceneEventData.cs:864)
Unity.Netcode.NetworkSceneManager.HandleClientSceneEvent (System.UInt32 sceneEventId) (at Library/PackageCache/com.unity.netcode.gameobjects@1.1.0/Runtime/SceneManagement/NetworkSceneManager.cs:1781)
Unity.Netcode.NetworkSceneManager.ClientLoadedSynchronization (System.UInt32 sceneEventId) (at Library/PackageCache/com.unity.netcode.gameobjects@1.1.0/Runtime/SceneManagement/NetworkSceneManager.cs:1747)
Unity.Netcode.SceneEventProgress.<SetAsyncOperation>b__37_0 (UnityEngine.AsyncOperation asyncOp2) (at Library/PackageCache/com.unity.netcode.gameobjects@1.1.0/Runtime/SceneManagement/SceneEventProgress.cs:236)
UnityEngine.AsyncOperation.InvokeCompletionEvent () (at <4a31731933e0419ca5a995305014ad37>:0)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
outercloudstudiocommented, Nov 3, 2022

Thank you! A new clone fixed it. Sorry for taking your time.

1reaction
NoelStephensUnitycommented, Nov 1, 2022

@outercloudstudio Thank you for submitting that. Will be looking at it today and let you know what I find.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The given key was not present in the dictionary. Which key?
This exception is thrown when you try to index to something that isn't there, for example: Dictionary<String, String> test = new ...
Read more >
The given key was not present in the dictionary. (UNET)
So here it is: Error: KeyNotFoundException: The given key was not present in the dictionary. System.Collections.Generic.Dictionary`2[System.
Read more >
“The given key was not present in the dictionary ...
Created a new Schema attribute called MyGroupList of DataType OptionList with 2 options in the list, Option A and Option B. The purpose...
Read more >
[Solved] The given key was not present in the dictionary
Solution 1. Hi, Actually this exception occur when you are accessing Dictionary for Incorrect value. Here i have created one code snippet for ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found