Additive Scenes using Scene Interest Management component throws the follow error in hosted mode:
KeyNotFoundException: The given key was not present in the dictionary
That line shows:
Scene currentScene = lastObjectScene[identity];
The lastObjectScene is normally populated (I think) in the OnSpawned function. Logging that function it is never called. Is there a setup issue I have done that I need to be aware of or is this a bug in this code? Using unity 2020.3.14f1 (LTS), with using Mirror: 55.2.1
How To Reproduce
Open Unity 2020.3
Import Mirror v55.3.5
Add "Assets/Mirror/Examples/AdditiveScenes/Scenes/MainScene.unity" To Build Settings Index 0
Add "Assets/Mirror/Examples/AdditiveScenes/Scenes/SubScene.unity" to build settings index 1
Open MainScene and modify NetworkManager to include Scene Interest Managment component
a. Select the NetworkManager gameobject
b. Delete the Distance Interest Management component
c. Add the Scene Interest Management component
Click play in the unity editor
Select the Host (Server + Client) button
Open the console - view the ever increasing number of errors
Expected behavior
When spawning a network identity it should trigger the OnSpawned event in the Scene Interest Management component. It doesn't seem to do that, which triggers an endless error being thrown (which will cause a game to eventually crash). It should be populating the lastObjectScene dictionary.
Desktop (please complete the following information):
Windows 10
Build target: Windows
Unity version: 2020.3.14f1, NOTE: Also tried 2020.2
Release: v55.2.1, NOTE: Also tried v55.3.5
Additional context
I have deleted all my project files, reimported them, restarted my computer, nothing.
Describe the bug
Additive Scenes using Scene Interest Management component throws the follow error in hosted mode:
That line shows:
Scene currentScene = lastObjectScene[identity];
The
lastObjectScene
is normally populated (I think) in theOnSpawned
function. Logging that function it is never called. Is there a setup issue I have done that I need to be aware of or is this a bug in this code? Using unity2020.3.14f1 (LTS)
, with using Mirror:55.2.1
How To Reproduce
MainScene
and modifyNetworkManager
to includeScene Interest Managment
component a. Select theNetworkManager
gameobject b. Delete theDistance Interest Management
component c. Add theScene Interest Management
componentHost (Server + Client)
buttonExpected behavior
When spawning a network identity it should trigger the
OnSpawned
event in theScene Interest Management
component. It doesn't seem to do that, which triggers an endless error being thrown (which will cause a game to eventually crash). It should be populating thelastObjectScene
dictionary.Desktop (please complete the following information):
Additional context I have deleted all my project files, reimported them, restarted my computer, nothing.