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.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Unet problems when scenes aren't exactly the same

Discussion in 'UNet' started by martaaay, May 28, 2018.

  1. martaaay

    martaaay

    Joined:
    Apr 13, 2009
    Posts:
    136
    It seems Unet breaks when i have a host and client with two scenes that are even slightly different - for instance, if there's a seemingly minor bug fix on the server's copy of the scene. Is this expected? If so, are there best practices for dealing with this?

    If it's not just a bug I can fix, I'm planning to go the route of telling users that they have to match agme versions (if those 2 version had a change in the multiplayer scene they want to play).
     
  2. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,331
    You need exactly the same scene because HLAPI assigns sceneIDs to NetworkBehaviours in the scene.
    If they have different ids then bad things will happen :)

    Note that there is a sceneId 'matching' bug anyway. So even if you have the same scene, you will still get errors. See HLAPI Pro (signature) for a fix.
     
  3. martaaay

    martaaay

    Joined:
    Apr 13, 2009
    Posts:
    136
    Thanks! Yep, I used HLAPI Pro for mine for this very reason, thank you!!

    In your games, do you simply have to require people have the same version?
     
  4. martaaay

    martaaay

    Joined:
    Apr 13, 2009
    Posts:
    136
    Crazy idea - and it's probably not this simple - but could a public field be added to NetworkIdentity to generate a static unique sceneID in the editor?
     
  5. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,331
    Yes.