Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

[Netcode]Issue with NetcodeObjects synchronisation and blocked scenes

Discussion in 'Multiplayer' started by Omgoor, Jan 17, 2023.

  1. Omgoor

    Omgoor

    Joined:
    Apr 11, 2017
    Posts:
    2
    Hi,

    i have following issue:
    1. My host is loading three different scenes A, B and C ( B&C are additiv) which contains networkobjects.
    2. My client make a latejoint to the host.
    3. My Client get the information with the required scene. Through SceneManager.VerifySceneBeforeLoading i can block scene b, so my client is only loading scene A and C.



    4. Now the networksynchronisation-circle starts and thats where the issue begins. On my client scene A is synchonized, because Netcode can't find objects from scene B, it breaks the synchronisation and objects from scene C will be not synchronized.

    Edit:

    I found the reason in NetworkObject.cs line 1296. When i comment both out, it "works". Of cause, when i comment both line out, i will get a error, when netcode try to send the synchronizationresult to the host. But beside of this, I don't know if this if-statement will ever be use. Because from my understanding, this can only be called, when the client has missing netcode-objects, which should not be the case (accept blocking scenes) and if yes, why do we need to move the handle in readvaluesafe() and in seek()? In this case we have only to change the variabledata.position once.

    Please correct me, if i'm wrong.




    What I'm actually searching is an out of the box solution. In this case i have to change code in the netcode package, which i really don't prefer.
    I also found a workaround: Let the client load all scenes and then unload all scenes, which the clients don't need. But this solution is kind of an overhead-solution for me.

    I would be grateful for any help :)
     
  2. Omgoor

    Omgoor

    Joined:
    Apr 11, 2017
    Posts:
    2
    I post this question also on the netcode github and got an answer from Unity:

    upload_2023-1-23_17-12-24.png

    for me, this question is now done, but i let this thread for future generation open :)