com.unity.netcode.gameobjects icon indicating copy to clipboard operation
com.unity.netcode.gameobjects copied to clipboard

NetworkTransform can't be disabled via MonoBehaviour's enabled property, results in NT TICK DUPLICATE

Open zachstronaut opened this issue 1 year ago • 2 comments

If you disable NetworkTransform on all clients by setting the enabled property to false you get a bunch of these errors:

[Netcode] [NT TICK DUPLICATE] Server already sent an update on tick 2340 and is attempting to send again on the same network tick!

You can disable sync functionality without the errors by doing something like:

netTransform.Interpolate = false;
netTransform.SyncPositionX = false;
netTransform.SyncPositionY = false;
netTransform.SyncPositionZ = false;
netTransform.SyncRotAngleX = false;
netTransform.SyncRotAngleY = false;
netTransform.SyncRotAngleZ = false;

I would expect to be able to stop the NetworkTransform completely by setting enabled to false, or if that seems weird, then by some other mechanism.

zachstronaut avatar Apr 17 '24 16:04 zachstronaut

Good catch and this just requires checking if it is enabled or not when updating and exiting early if not (or possibly de-registering)

NoelStephensUnity avatar Apr 22 '24 14:04 NoelStephensUnity

@zachstronaut just confirming which version you are on. The error message is in 1.7.1 but changed during 1.8.0: https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/pull/2777 It might be enough for you to upgrade to resolve your error.

miniwolf avatar Apr 24 '24 12:04 miniwolf

Closing this as I have received no more information. If this is still an issue on the latest version 1.9.1 feel free to re-open or make a new ticket.

miniwolf avatar May 06 '24 15:05 miniwolf