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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Resolved Animation Rigging over the network

Discussion in 'Netcode for GameObjects' started by XeLLLeR, Jun 13, 2022.

  1. XeLLLeR

    XeLLLeR

    Joined:
    Dec 5, 2020
    Posts:
    30
    So question is very simple, how to sync animation rigging over the network? I know that I must set animator triggers with rpc calls, but I can't handle animation rigging that way or I don't know something. Any suggestions?
     
  2. kiranmaya

    kiranmaya

    Joined:
    May 27, 2010
    Posts:
    218
    hi, did you find any solution?
     
  3. RikuTheFuffs-U

    RikuTheFuffs-U

    Unity Technologies

    Joined:
    Feb 20, 2020
    Posts:
    426
    Hi @XeLLLeR , what do you mean by sync animation rigging ? Are you already using the ClientNetworkAnimator script?

    Code (CSharp):
    1. using Unity.Netcode.Components;
    2. public class ClientNetworkAnimator : NetworkAnimator
    3. {    
    4.      protected override bool OnIsServerAuthoritative()    
    5.      {        
    6.            return false; //allows the client to send animations data over the network    
    7.      }
    8. }
     
    codeBatt likes this.
  4. nullmoongames

    nullmoongames

    Joined:
    Dec 23, 2019
    Posts:
    10
    You probably need to rebuild the Rig for all clients. I will try this solution and post the result here
     
  5. liambilly

    liambilly

    Joined:
    May 13, 2022
    Posts:
    86
    i have the code
    rigbuilder.Build();
    the rigged anims still dont synch,
    i also have client networktransform components on the constrained and source objecs,still doesnt work
    anyone found a solution for this yet,
     
    Last edited: Feb 15, 2023
  6. liambilly

    liambilly

    Joined:
    May 13, 2022
    Posts:
    86
    i found a solution, from an idea i got from code monkey, apart from attaching networktransform to the ik targets also you need to change the rig layer weights with a networkvariable
     
  7. Traiforce

    Traiforce

    Joined:
    Feb 6, 2017
    Posts:
    3
    i still have some problems setting it up you around for a quick chat im lose to fixing it i just think im missing somthing
     
    Last edited: Mar 28, 2023
  8. codeBatt

    codeBatt

    Joined:
    Feb 12, 2020
    Posts:
    40
    I still have the same issues. What should I do in the following video my character animations does not sync. I do animations on two animators, one of them is a rigcontroller and used animation rigging. Both of the objects have clientAnimatorTransform component. Should I add networkObject for all the bones?
    @RikuTheFuffs-U
     
  9. liambilly

    liambilly

    Joined:
    May 13, 2022
    Posts:
    86
    subscribe to your networkvariable onvaluechanged, when u need to change the weights change its value instead then update the rig weights in the onvaluechanged delegate
     
    codeBatt likes this.
  10. liambilly

    liambilly

    Joined:
    May 13, 2022
    Posts:
    86

    if you still experience this issue watch this video on how to solve the problem
     
    The_ZayNepz_Guy and codeBatt like this.