Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Resolved How to matchup GlobalObjectHash in 2 networkobjects from 2 projects?

Discussion in 'Netcode for GameObjects' started by sava-game, Apr 11, 2023.

  1. sava-game

    sava-game

    Joined:
    Feb 14, 2023
    Posts:
    21
    Hello there.
    I have 2 projects using netcode for gameobjects, One is client, the other one is server, how to matchup GlobalObjectHash in 2 networkobjects from 2 projects?

    Please help me.
    Thank you in advance.
     
  2. RikuTheFuffs-U

    RikuTheFuffs-U

    Unity Technologies

    Joined:
    Feb 20, 2020
    Posts:
    440
    Hi, I asked this internally and will come back when I have an answer!
     
  3. RikuTheFuffs-U

    RikuTheFuffs-U

    Unity Technologies

    Joined:
    Feb 20, 2020
    Posts:
    440
    Hey @sava-game , I've got an answer from the team regarding your case.

    If you're trying to separate your server and client applications and want your server application using a different asset than the client one (i.e., an asset with no rendering, for example), we have a prefab/hash override settings for that. (ome examples here)

    You can generate prefabs on the server, and then create a different set of prefabs on the client and set a hash override so that object gets used for the server object's hash.
    The real difficulty there is figuring out the server object's hash and keeping that maintained since the server object's hash could change.

    You could also create "generic" prefabs as their addressables and then override them.
    So, using a "generic" addressable that had the same GlobalObjectIdHash value and then overriding that for the client or server project to yield a specific instance based on the project is a potential way to solve for this.

    Does this help?
     
  4. sava-game

    sava-game

    Joined:
    Feb 14, 2023
    Posts:
    21
    yes, it is very helpful for me.
    Thank you
     
    RikuTheFuffs-U likes this.