Loading scene on new client causes an error

trzy
trzy
edited December 2022 in Fusion

Hi,

I'm additively loading scenes in Shared mode on both clients (the scene to be loaded is requested via a network-synced variable similar to the scene loading example code). This seems to work fine. I can load/unload the scene repeatedly. But when the non-master client disconnects and then reconnects, I get a strange set of errors:


Ball [Id:524295]: Scene object is already attached to, won't allow this to be attached [Id: [Id:524293], SceneGuid: ad11b534-7ffc-46a6-8fe7-3d0f9dad5374, ...

Ball [Id:524295]: Scene object is already attached to, won't allow this to be attached [Id: [Id:524297], SceneGuid: ad11b534-7ffc-46a6-8fe7-3d0f9dad5374, ...


Note that when a client disconnects, the scene is unloaded on the master client, and it seems everything gets destroyed. The scene is only loaded when two clients are connected. So what happens is this:


  1. Client A brought up, becomes shared master.
  2. Client B brought up, Client A (master) detects this and sets a scene to be loaded.
  3. Clients A and B both load this scene additively.
  4. Client B disconnects.
  5. Client A detects disconnect and unloads the scene locally.
  6. Client B brought up again.
  7. Client A detects this, sets a scene to be loaded.
  8. Client A loads the scene just fine but interestingly, the Ball object is in the position it was before the scene last got unloaded.
  9. Client B loads the scene and spews this error (ball is in the same position as on Client A)

What is causing this?

I don't see any special handling of scene unloading in the example.

Thanks,

Bart


EDIT: Here is a screenshot of the error, although in this case it occurred after a client disconnected/reconnected and then disconnected again, causing the scene to be unloaded. As soon as that happened, this error was triggered.