From 4ca899a28d27f6b11a53e63e81f2081421627095 Mon Sep 17 00:00:00 2001 From: David Woodruff Date: Mon, 10 May 2021 17:18:18 -0400 Subject: [PATCH 1/2] moving position and rotation to MLAPI's PositionUpdate channel (sequenced, unreliable). This significantly improves user experience in high-packet-loss scenarios --- .../Scripts/Shared/Game/Entity/NetworkCharacterState.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Assets/BossRoom/Scripts/Shared/Game/Entity/NetworkCharacterState.cs b/Assets/BossRoom/Scripts/Shared/Game/Entity/NetworkCharacterState.cs index 4e20cc6de..deb7a2ad3 100644 --- a/Assets/BossRoom/Scripts/Shared/Game/Entity/NetworkCharacterState.cs +++ b/Assets/BossRoom/Scripts/Shared/Game/Entity/NetworkCharacterState.cs @@ -45,7 +45,8 @@ public void InitNetworkPositionAndRotationY(Vector3 initPosition, float initRota /// /// The networked position of this Character. This reflects the authoritative position on the server. /// - public NetworkVariableVector3 NetworkPosition { get; } = new NetworkVariableVector3(); + public NetworkVariableVector3 NetworkPosition { get; } = new NetworkVariableVector3( + new NetworkVariableSettings() { SendNetworkChannel = MLAPI.Transports.NetworkChannel.PositionUpdate }); /// /// The networked rotation of this Character. This reflects the authoritative rotation on the server. From ae54f5671b311282a20c84c2cd23d7423fbaec76 Mon Sep 17 00:00:00 2001 From: David Woodruff Date: Mon, 10 May 2021 17:18:43 -0400 Subject: [PATCH 2/2] adding the rotation part of the prior change --- .../Scripts/Shared/Game/Entity/NetworkCharacterState.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Assets/BossRoom/Scripts/Shared/Game/Entity/NetworkCharacterState.cs b/Assets/BossRoom/Scripts/Shared/Game/Entity/NetworkCharacterState.cs index deb7a2ad3..23a096f6b 100644 --- a/Assets/BossRoom/Scripts/Shared/Game/Entity/NetworkCharacterState.cs +++ b/Assets/BossRoom/Scripts/Shared/Game/Entity/NetworkCharacterState.cs @@ -51,7 +51,8 @@ public void InitNetworkPositionAndRotationY(Vector3 initPosition, float initRota /// /// The networked rotation of this Character. This reflects the authoritative rotation on the server. /// - public NetworkVariableFloat NetworkRotationY { get; } = new NetworkVariableFloat(); + public NetworkVariableFloat NetworkRotationY { get; } = new NetworkVariableFloat( + new NetworkVariableSettings() { SendNetworkChannel = MLAPI.Transports.NetworkChannel.PositionUpdate }); /// /// The speed that the character is currently allowed to move, according to the server.