Search Unity

Resolved Alternative to network List

Discussion in 'Netcode for GameObjects' started by lavagoatGG, Jul 26, 2022.

  1. lavagoatGG

    lavagoatGG

    Joined:
    Apr 16, 2022
    Posts:
    229
    Hello,
    I am making a game where players join a lobby and when they are all ready the host can start a game.
    I am checking if each player is ready with a list of bools on the server. If the first place in the list is true, than the first player is ready.
    Each player has a button that can change the value in their place on the list and when the list value changes all player should be notified and be informed that a certain player is ready.
    My problem is that the list is not synchronizing: Exception: Shouldn't be here, index is higher than list length ...
    Is there any other way of doing this?
    Thank you.
     
  2. cerestorm

    cerestorm

    Joined:
    Apr 16, 2020
    Posts:
    661
    There's a bug in the release version of Netcode preventing synchronization of network lists. It's fixed in the develop branch so give that a go.
     
  3. lavagoatGG

    lavagoatGG

    Joined:
    Apr 16, 2022
    Posts:
    229
    I am not sure how to try it... Also, I don't want my game to depens on unreleased version because it might be unstable
     
  4. cerestorm

    cerestorm

    Joined:
    Apr 16, 2020
    Posts:
    661
    You can use the develop branch for now and switch back to release once the fix goes in. I don't know if you can add develop directly with the package manager. I used the Github Desktop app then added the package from disk. If you need any help with that just shout.
     
  5. lavagoatGG

    lavagoatGG

    Joined:
    Apr 16, 2022
    Posts:
    229
    Hi, I don't know how to use the fix, I downloaded the github desktop app. I would like it if you guide me
     
  6. cerestorm

    cerestorm

    Joined:
    Apr 16, 2020
    Posts:
    661
    From the Netcode Github page click the green Code dropdown and select Open with Github Desktop. Follow any prompts to launch Github Desktop, choose a folder for the project and click Clone.

    Once it's cloned go into Unity, open the Package Manager and remove the Netcode release package. After click the + dropdown and select Add package from disk... and find the folder where you cloned the Netcode project. Inside the com.unity.netcode.gameobjects folder select the package.json file to install it.
     
  7. lavagoatGG

    lavagoatGG

    Joined:
    Apr 16, 2022
    Posts:
    229
    Thank you! It works
     
    cerestorm likes this.