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. 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:
    20
    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:
    426
    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:
    426
    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:
    20
    yes, it is very helpful for me.
    Thank you
     
    RikuTheFuffs-U likes this.