From b31eeb5a4fdb2fdcaef8f53f059d6e32950ff3e3 Mon Sep 17 00:00:00 2001 From: vis2k Date: Sat, 22 Oct 2022 10:26:31 +0200 Subject: [PATCH] NetworkTransform: force syncDirection to follow the old clientAuthority state to make it obvious that there is only one source of truth --- .../Components/NetworkTransform2k/NetworkTransformBase.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Assets/Mirror/Components/NetworkTransform2k/NetworkTransformBase.cs b/Assets/Mirror/Components/NetworkTransform2k/NetworkTransformBase.cs index 65376f680..9b73d8ebe 100644 --- a/Assets/Mirror/Components/NetworkTransform2k/NetworkTransformBase.cs +++ b/Assets/Mirror/Components/NetworkTransform2k/NetworkTransformBase.cs @@ -91,6 +91,11 @@ protected virtual void OnValidate() // both always need to be on the same send interval. // force it in here. syncInterval = NetworkServer.sendInterval; + + // NetworkTransform doesn't use SyncDirection yet. + // it still uses 'clientAuthority' to indicate authority. + // make it obvious that there's only one source of truth. + syncDirection = clientAuthority ? SyncDirection.ClientToServer : SyncDirection.ServerToClient; } // snapshot functions //////////////////////////////////////////////////