From 5fbba01ca004d31d2e3b2a81afc9f8a89f3cebf2 Mon Sep 17 00:00:00 2001 From: Sveske_Juice Date: Tue, 5 Mar 2024 00:28:27 +0100 Subject: [PATCH] rope :(( --- Assets/Scripts/Rope/RopeSimulator.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Assets/Scripts/Rope/RopeSimulator.cs b/Assets/Scripts/Rope/RopeSimulator.cs index 8342616..8cce661 100644 --- a/Assets/Scripts/Rope/RopeSimulator.cs +++ b/Assets/Scripts/Rope/RopeSimulator.cs @@ -66,7 +66,7 @@ public class RopeSimulator : NetworkBehaviour [Header("Netcode")] private const int k_rngSeed = 6969; private const float k_sendRopeDataRPCThreshold = 0.1f; - private const float k_ropeReconciliateThreshold = 0.25f; + public float k_ropeReconciliateThreshold = 8f; private System.Random rng = new System.Random(k_rngSeed); private int[] order; @@ -286,9 +286,9 @@ public class RopeSimulator : NetworkBehaviour Debug.Log(diff); if (diff > k_ropeReconciliateThreshold) { - Debug.LogWarning("Reconciliating rope!"); - this.rope = serverRope; - Debug.Log(Rope.CalcDiff(this.rope, serverRope)); + // Debug.LogWarning("Reconciliating rope!"); + // this.rope = serverRope; + // Debug.Log(Rope.CalcDiff(this.rope, serverRope)); } } @@ -303,7 +303,7 @@ public class RopeSimulator : NetworkBehaviour rope.points.Last().position = end.position; float ropeDiff = Simulate(Time.fixedDeltaTime); - if (IsServer && ropeDiff > k_sendRopeDataRPCThreshold) + if (IsServer) { Debug.Log($"Sending rope to client"); NetworkRope nrope = Rope.ToNetworkRope(this.rope);