diff --git a/MLAPI/MonoBehaviours/Prototyping/NetworkedNavMeshAgent.cs b/MLAPI/MonoBehaviours/Prototyping/NetworkedNavMeshAgent.cs index d855ed0..1022c76 100644 --- a/MLAPI/MonoBehaviours/Prototyping/NetworkedNavMeshAgent.cs +++ b/MLAPI/MonoBehaviours/Prototyping/NetworkedNavMeshAgent.cs @@ -11,6 +11,9 @@ namespace MLAPI.MonoBehaviours.Prototyping public bool EnableProximity = false; public float ProximityRange = 50f; public float CorrectionDelay = 3f; + //TODO rephrase. + [Tooltip("Everytime a correction packet is recieved. This is the percentage (between 0 & 1) that we will move towards the goal.")] + public float DriftCorrectionPercentage = 0.1f; private static byte[] stateUpdateBuffer = new byte[36]; private static byte[] correctionBuffer = new byte[24]; @@ -153,7 +156,7 @@ namespace MLAPI.MonoBehaviours.Prototyping Vector3 position = new Vector3(xPos, yPos, zPos); agent.velocity = velocity; - agent.Warp(position); + agent.Warp(Vector3.Lerp(transform.position, position, DriftCorrectionPercentage)); } } }