com.unity.netcode.gameobjects
com.unity.netcode.gameobjects copied to clipboard
Animations do not Sync when using Client Network Transform from Samples
Describe the bug When installing and using the Sample Client Network Transform the Network animator will stop syncing the animator values and the remote Animations from Player B will not play in Player A's screen.
To Reproduce Steps to reproduce the behavior:
- Install Netcode for Gameobjects
- Install Sample Client Network Transform
- Have an Animator with Animations
- In the "Player" add the components: NetworkObject, ClientNetWork Transform and Network Animator
- Launch a Client and Host/Server
- Watch the Animator Component from the remote object not syncing the Variables nor the Animations.
Actual outcome Remote Animations do not play in local clients and Vice-Versa.
Expected outcome The Animations should play in local clients and remote clients and the animatiors should be synced.
Environment (please complete the following information):
- OS: Windows 10
- Unity Version: 2021.1.25f1
- Netcode Version: 1.0.0
Additional info -This issue was not present in MLAPI 0.1.0
Same issue :( ! (Animator parameters not synced)
For me, it is not working even when using the regular NetworkTransform. I'm on 1.0.0-pre.2.
I just found out that using the Boss Room Network Animator works (sort of). It does not actively sync as it was supposed to, but it's a start.
Managed to get Anims Working by using RPC's to set Anims params, but this should not be needed.
Seems like it's fixed in master https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/pull/1327
it's not, i tried both master and devop 1.0.0 pre3 none work
@FSKiller the way I made it work is actually copying the code of NetworkAnimator into my own MyNetworkAnimator and commenting out those "if (valueInt != oldValue)" statements in WriteParameters
As Luke said on Discord their new implementation is Server Authoritive, i managed to get them working too, but i used Rpc's to call the values. This is a pain if you want a Client Authoritive Game....
Added to the backlog as MTT-1565
I have the same issue. @aazzolini's solution of making a new NetworkAnimator with the if statements commented out caused some animations to be synched, but only certain transitions (for example into running, but not back into standing still). It's only one way too: the client gets to see some of the animations of the host, but the host sees none of the client.
As Luke said on Discord their new implementation is Server Authoritive, i managed to get them working too, but i used Rpc's to call the values. This is a pain if you want a Client Authoritive Game....
Many indie projects are better off client authoritative. Less headaches in general, cheating isn't really a consideration, all that matters is to finish the game and get players.
Hopefully they support more client auth stuff, not just server or do it yourself.
As Luke said on Discord their new implementation is Server Authoritive, i managed to get them working too, but i used Rpc's to call the values. This is a pain if you want a Client Authoritive Game....
@will-mearns if this is the case can we please update the documentation (https://docs-multiplayer.unity3d.com/docs/components/networkanimator) that it won't work with clients setting params on the animator? It seems to imply that all you need to do is add a NetworkAnimator and you're good to go. Spent quite a few hours debugging the NetworkAnimator script only to find that it may actually be a bug?
Let me know if I misunderstood this. Thanks!
Any news on this, maybe an approximate date? It is basically useless if you use an asset that does all the animations if they can't be synced.
My game is client-sided but I'm now facing this issue as well. And It'll be problematic to switch to server authoritative due to lag issues.
Especially since NGO doesn't have client prediction.
On Tue, Jan 18, 2022 at 11:19 PM MiTschMR @.***> wrote:
Any news on this, maybe an approximate date? It is basically useless if you use an asset that does all the animations if they can't be synced.
— Reply to this email directly, view it on GitHub https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/issues/1348#issuecomment-1015801607, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANGM4YU5DOS2ZGOUB2GIXXLUWXDOTANCNFSM5GSRNQVA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you commented.Message ID: <Unity-Technologies/com.unity.netcode.gameobjects/issues/1348/1015801607@ github.com>
What I found out using 1.0 pre-5 is that if the Player you are controlling is instantiated on a Host, the animation sync happens if the NetworkAnimator component has the checkboxes checked. However, if you are a simple client, it doesn't happen because it is server authoritative. How would you guys do it if an asset you own has a player component that handles all the input via its own code and can't be changed without major refactoring? In my opinion there should be a checkbox or something similar to let the clients control the movement if checked. This way you can cover both easily with a single click and focus on the interactive part of the game (which is easily possible to control via the server).
The network animator has been reworked with 1.0 pre-6 and now looks differently in the inspector, it does not show checkboxes anymore. Is there internal work being done or what was the reason for it?
Ok, i just found out about this. I'm currently using the ClientNetworkTransform and i was trying to make the Animator work without luck.
Hoping this can get updated.
https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/pull/1946
Should fix this. Can you confirm ?
Still not fixed. Players stay in idle animation and slide across the map.
As a temp fix i've been using RPC's to set the animator values, and this seems to work just fine at the cost of more network traffic.
Create this script and then remove the NetworkAnimator and add ClientNetworkAnimator
public class ClientNetworkAnimator : NetworkAnimator
{
protected override bool OnIsServerAuthoritative() => false;
}
@DevinWatson This isn't working for me. It enables the animations on the server but not on other clients.
@ChadGatling I did apply some fixes just recently to NetworkAnimator that are now in the develop branch that were not synchronizing if there were 2 clients so you might try your project with the develop branch and see if the fixes I applied resolve your issue. These fixes will be included in the next update.
If what is currently in the develop branch does not solve your issue, could you provide a project so I can try to replicate it on my end?
@NoelStephensUnity I am trying to verify this but I am getting a bunch of unrelated errors after updating to 1.1.0 and even just 1.0.2
@ChadGatling could you share the errors that you are getting? I might be able to assist you with those.
@NoelStephensUnity
Here is the first error I get with 1.1.0 as a client trying to connect to my server.
image removed
The server is seeing the client connect but then I get a handshake timeout. Then the server disconnects the client.
image removed
Thanks for looking.
@ChadGatling What version of Unity are you using? There was a recent update to make NetworkVariables handle managed types and this requires the most recent version of Unity (or higher) to use the current develop branch: 2021.3.11f1 LTS 2020.3.40f1 LTS 2022.1.19f1
As well, if you want to use a specific branch you can update your Packages\manifest.json file with something like this for com.unity.netcode.gameobjects:
"com.unity.netcode.gameobjects": "https://github.com/Unity-Technologies/com.unity.netcode.gameobjects.git?path=com.unity.netcode.gameobjects#develop",
"com.unity.transport": "1.3.0",
(I included the most recent version of unity transport in there too)
This can be useful if you want to make sure you have the most recent version of a specific branch without having to download and point to the specific directory etc.
If you were using an earlier version of Unity, let me know if updating to the more recent version resolves these error messages for you?
@NoelStephensUnity I updated my editor to 2021.3.11f1 and I am still getting the same issues
@NoelStephensUnity The previous still applies and I also tried it with Netcode for GameObjects 1.0.2 and on the server on player connect I am getting

and on the client right after connecting I get

The client actually connects but the network transform is not working. The animator works but the character remains in place. I am using client network transform and animator.
Edit: Seems like 2021.3 requires Shader graph 12.1.7 which breaks all my shader graph shaders so something is really messed up.
@ChadGatling Ahh...well at least the errors you are getting are different than before and so updating did help resolves those errors. It looks like you are still using the 1.0.0-pre.3 version of ClientNetworkTransform. Replace that with the updated version of ClientNetworkTransform. That should resolve the new errors you are getting.
@NoelStephensUnity So this version of ClientNetworkTransform is for the 1.0.2 version of Netcode for gameobjects? Or for 1.1.0? And all of this is to be used with Unity 2021.3.11? I can't seem to find the info about what version requires what version