Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Third Party Mirror Networking: synchronizing large amounts of children positions

Discussion in 'Multiplayer' started by BobyUnity, May 9, 2023.

  1. BobyUnity

    BobyUnity

    Joined:
    Apr 9, 2019
    Posts:
    30
    Hi There,

    I want to synchronize a "large" amount (lets say 30) of children transforms in the networkplayer.
    I find it very unclean to now add many networktransforms on the root player gameobject and also its very tedious since I have to do it a lot.
    When I try to write a script that synchronizes all the positions from the clients to the server it feels tempting to use dictionarys but I can not send dictionarys by commands. My dictionary would be a <int,Vec3>.
    So I would have to write a custom serialization for this dict or send all the positions in separate commands.

    My prefered option would have been to have networktransforms on all the transforms that I want to synchronize. Why did the devs decide that this is not a good way to set this up?

    One would now say that I should just put these 30 transforms into networktransforms since its the most performant way to do it. But since its not a game but an industry application that is usually not built but ran directly in the editor and does change every week its actually pretty tedious to allways change it in the root.
    It would be way easier to just have a main script object that detects the correct amout of objects and syncs them.

    What would your suggestion be?
    Thanks a lot
     
  2. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,352
    For now, please use NetworkTransforms on the root object.
    Allowing NetworkBehaviour components on child objects is on our roadmap, likely for this year.
     
  3. BobyUnity

    BobyUnity

    Joined:
    Apr 9, 2019
    Posts:
    30
    Thanks a lot for your fast reply!
    Ok very glad to hear that its coming. I need this. Root is not a prefered option unfortunately. For me and the team its hard to keep the oversight during the process with the customer since we have to change the setup live with the customer next to us so we have to figure something else out.
     
  4. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,352
    Please join our discord, see Github page.
    If it's high priority, we can get to it pretty soon.