Unity TICKS error

Hi =)
When I reach minute 11:50 of the video, and proceed to move the tank, Unity returns an error (but moves the tank correctly).
Investigating, it happens in the ClientNetworkTransform.cs class, in the line with: TryCommitTransformToServer(transform, NetworkManager.LocalTime.Time);

I don’t know if it is because of the version of some package.

Unity 2022.3.14f1
Netcode for Gameobjects 1.7.1

Help when you want.
Thanks in advance!

1 Like

Hi there,
Someone over on Udemy had a similar problem and solved it with the following code:

"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 don’t have to commit transform if client is server."

This might be a new error that has cropped up in version 1.7 of Netcode for GameObjects

1 Like

It is working as expected :smiley:
Thanks a lot!
!IsHost in the condition is the key.

Thank you for your quick response.
I really like GameDev.tv comunnity.

Have a good day!

1 Like

Privacy & Terms