From 105022427b1395fb80d7eb4d0011f291f761be9c Mon Sep 17 00:00:00 2001 From: excitedneon Date: Tue, 9 May 2017 19:06:50 +0300 Subject: [PATCH] Fix a serialization bug --- Assets/Scripts/Entities/Character.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/Entities/Character.cs b/Assets/Scripts/Entities/Character.cs index bbd9884..1e1b722 100644 --- a/Assets/Scripts/Entities/Character.cs +++ b/Assets/Scripts/Entities/Character.cs @@ -91,12 +91,14 @@ namespace Cyber.Entities { /// public override void Deserialize(NetworkReader reader) { Vector3 ServerPosition = reader.ReadVector3(); + Vector3 ServerMovementDirection = reader.ReadVector3(); + Vector3 ServerRotation = reader.ReadVector3(); + float Drift = (ServerPosition - transform.position).magnitude; if (Drift > MovementSpeed * 0.5f) { transform.position = ServerPosition; - MovementDirection = reader.ReadVector3(); + MovementDirection = ServerMovementDirection; } - Vector3 rot = reader.ReadVector3(); } ///