Search Unity

How do I synchronize movement for a bone?

Discussion in 'Netcode for GameObjects' started by AdamGomez, Jan 7, 2023.

  1. AdamGomez

    AdamGomez

    Joined:
    Mar 10, 2018
    Posts:
    2
    Hi everybody. I just started using Netcode for GameObjects two days ago, so I am still very confused about this.

    In my game, I want the player camera's X rotation to influence a spine bone so that the character model looks up and down with the player. I have this code working, but I'm unsure how to synchronize the bone movement for all other clients.

    My main problem is trying to sync the rotation of a child object, which doesn't work and gives me this error:
    Spawning NetworkObjects with nested NetworkObjects is only supported for scene objects. Child NetworkObjects will not be spawned over the network!


    Is there a way to get this working?
     
  2. Evil-Otaku

    Evil-Otaku

    Joined:
    Oct 17, 2012
    Posts:
    72
  3. AdamGomez

    AdamGomez

    Joined:
    Mar 10, 2018
    Posts:
    2
  4. Evil-Otaku

    Evil-Otaku

    Joined:
    Oct 17, 2012
    Posts:
    72
    If you put a network transform on the IK targets, yes
     
  5. liambilly

    liambilly

    Joined:
    May 13, 2022
    Posts:
    154
    yes this works, but also dont forget to change the riglayer weights with a networkvariable
     
    Last edited: Feb 17, 2023