About NetworkMecanimAnimator animation layer synchronization problem

I used two layers to play the animation, the second layer was used to hold the lower body, and the upper body played the raised hands. During the synchronization process, I found that the Host moves every time, the Host behaves correctly, and the animation of the second layer of the Client fails to play successfully (as shown in the figure below, I check the currently playing Animation in the Animator panel is correct, but it does not actually show ). Instead, the client moves, both Host and Client behave correctly


Best Answer

  • vimrzhang
    vimrzhang
    Answer ✓

    I turned off the synchronization of the weightlayer variable and it worked fine. Although it's not clear to me why there is a problem with the weightlayer value synchronization

Answers

  • The wrong animation performance of the client is: only the moving animation is played, and the animation of raising the upper body is gone.

  • It seems that the weight of this animation is not updated synchronously

  • _networkAnimator.Animator.SetLayerWeight(1,1);
    

    I force the weight to 1 and the upper body animation does not play。

    left is the host,right is the client.


  • vimrzhang
    vimrzhang
    Answer ✓

    I turned off the synchronization of the weightlayer variable and it worked fine. Although it's not clear to me why there is a problem with the weightlayer value synchronization

  • emotitron
    emotitron ✭✭✭
    edited September 16

    Do you have StateLayers also checked in the Sync Settings? Syncing the layer weight without that might produce strange results in your case? Though that seems unlikely. There isn't a known bug relating to layer weights, so I would need to get a repro to see what is going wrong with your particular animator.

    You are definitely setting the weight on only the StateAuthority and InputAuthority, and you are not seeing the changes on the Proxies?

  • emotitron
    emotitron ✭✭✭
    edited September 16

    ---

  • Do you have StateLayers also checked in the Sync Settings?

    I have it set, and there is no code that modifies the layer weight. But when I click move button, the host player's Proxies weight value has changed, from 1 to 0 and then to 1,

  • So you are not changing the layer weight at all? I would disable LayerWeight syncing then yes.

    I am not able to replicate any problems with Layer Weights, so we would need a repro to see how you are getting it to fail. I would also be sure to be a recent nightly version of Fusion.

  • My game did not change the layer weight, so I turned off the layer weight synchronously and solved the problem.

    After a while, I will try to build a test scene to recover the problem