#Moving gameobjects manually vs DDOL

16 messages · Page 1 of 1 (latest)

rain osprey
#

Hey there,

Just recognised a bit of a gap in my knowledge:
A few months back, I got the tip from you to move objects between scenes manually with
SceneManager.MoveGameObjectToScene( MultiplayerModeChanger.Instance.gameObject , SceneManager.GetActiveScene() );

Now I am wondering: is this needed for DDOL objects (singletons, more specifically)?
It seems to be causing some issues with it there, but since you recommended it last time I was changing scenes I'm wondering if I just understood something wrong.
Kind regards!
http://pastie.org/p/1bZHDpiyXxskpsxmQ4dGQX

lime hazel
rain osprey
#

we're not using IM

#

I made the players persist by making them DDOL, is that a bad thing?

#

Aside from that, I have code moving managers that aren't the players between scenes, that are singleton ddol, but it seems to give issues when moving those with the scene movegameobj

lime hazel
rain osprey
#

Back then I had used it on every single singleton I had... no IM or anything

rain osprey
#

When switching scenes, is there some sort of event I can listen in to for when each client has loaded into the scene? Given that they all transfer at the same time of course.

#

I am thinking of OnClientSceneChange, but that would only be for one client, right?

lime hazel
rain osprey
#

Okay, nothing for when everyone is loaded and ready? I've implemented a custom handshake system now, which starts a handshake server side OnServerChangeScene, then OnClientSceneChanged it accepts the handshake - when all players accepted the code is run

#

But of course it would be a little overengineered if there was something built-in ready

lime hazel
#

Internally Mirror sets all clients NotReady and then sends them all the scene message to change scenes. After loading it on client, Mirror sends Ready msg back to server, which invokes OnServerReady with the conn of the client so you know which one, but all you need is a counter there.

rain osprey
#

Okay, thank you