#"Exception: Server Scene Handle already exist!"

1 messages · Page 1 of 1 (latest)

craggy swift
#

hello, i get this error when joining the host:
Exception: Server Scene Handle (-7546) already exist! Happened during scene load of test with Client Handle (-1647404)
Unity.Netcode.NetworkSceneManager.OnSceneLoaded

the client loads the scene the moment the host starts the game, but the clients scene is not synced/networked and i get the error

my code:
https://codeshare.io/5vzKbk

stark atlas
#

Is StartGame() getting broadcast to all clients? It sounds like the host might be trying to load the scene twice for some reason.

Also I wouldn't have this game object destroy itself.

craggy swift
#

ah sorry yeah the destroy is from the ai i thought it might help fix it but it didn't lmao

startgame, as you can see is only ran when the host starts the game

#

i searched in my project and this is the only loadscene (except loading the main menu)

stark atlas
#

You'll need to make triple sure that LoadScene() is not getting called multiple times somehow.
You might also want to try manually calling StartGame() instead of using the coroutine.

craggy swift
craggy swift
#

hol up maybe i found the issue

#

nevermind

stark atlas
#

Hang on, are you getting this error on the host or on the client?

craggy swift
#

client

stark atlas
#

Ok that is weird. I'm not sure why the client is getting a server scene handle exception. Is the scene fully loaded on the host when the client tries to join?

craggy swift
#

the host loads the scene. i can even spawn in units (its an rts) and the units appear on the client, but if i move them they don't move

stark atlas
#

Ok there is something else going on there. Is the client starting from a main menu scene?

craggy swift
#

the lobby is in the main menu and as you can see in the code when the lobby data changes to true it joins the session

#

and loads the scene

#

i am investigating rn maybe i find something

i thought maybe it is the network prefabs

stark atlas
#

It might be due to changing the status to true before the scene has finished loaded.

craggy swift
#

i thought of a lot of things like that but why does the client see the prefabs being spawned then xD

#

anyway it's late and its christmas tomorrow (for me at least)

#

good night

stark atlas
#

Happy Holidays

craggy swift
#

welp i think i fixed it

#

it seems like (i think) when a network variable isnt initialized it causes the same error?