Fatal Error When Moving or Rotating

Anytime I push any of the movement input keys (WASD or Arrows) I get the following fatal error:

[Netcode] [NT TICK DUPLICATE] Server already sent an update on tick 33 and is attempting to send again on the same network tick!
UnityEngine.Debug:LogError (object)
Unity.Netcode.NetworkLog:LogError (string) (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.7.1/Runtime/Logging/NetworkLog.cs:34)
Unity.Netcode.Components.NetworkTransform:TryCommitTransform (UnityEngine.Transform&,bool) (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.7.1/Components/NetworkTransform.cs:1442)
Unity.Netcode.Components.NetworkTransform:OnUpdateAuthoritativeState (UnityEngine.Transform&) (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.7.1/Components/NetworkTransform.cs:2475)
Unity.Netcode.Components.NetworkTransform:TryCommitTransformToServer (UnityEngine.Transform,double) (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.7.1/Components/NetworkTransform.cs:1378)
ClientNetworkTransform:Update () (at Assets/Scripts/Utilities/ClientNetworkTransform.cs:21)

I don’t believe this is a script issue as I checked the PlayerMovement script and that matches what’s in the lecture. I also double checked the Player Prefab and there is only one PlayerMovement script on the object and a ClientNetworkTransform on the same parts that were called out to attach it to in the lecture. I am only doing this in the editor (I have not made a build yet) and am selecting the Host button. If any more information is needed please let me know. Any help would be greatly appreciated.

1 Like

Hi there,
Another student had this problem and used the following solution:

"Try this in ClientNetworkTransform.cs:

override protected void Update()
{
CanCommitToTransform = IsOwner;
base.Update();
if (!IsHost && NetworkManager != null && NetworkManager.IsConnectedClient && CanCommitToTransform)
{
TryCommitTransformToServer(transform, NetworkManager.LocalTime.Time);
}
}

You dont have to commit transform if client is server."

I have passing that around and it has helped most people who have this problem. I think it’s associated with a specific version of Unity + NetCode for Game Objects, what versions are you using?

1 Like

Sorry for the late reply but finally was able to try this out. With the code you provided I was able to get it to work.

I did though also reach out to the Unity Multiplayer Networking Discord and was directed to this page: NetworkTransform | Unity Multiplayer Networking. I used the example in it and it also worked. Seems like what you provided covers a bit more edge cases kind of thing so I think I’m going to stick with that but just wanted to bring attention to another possible way of doing it.

Thanks again for the help!

Great, thanks! Glad you got it working!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms