From a997a0682faa38a0d1edab819ead91cf448037c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C5=A1a=20Ceviel?= Date: Fri, 5 Dec 2025 11:55:49 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BB=D0=B0=D0=B9=D0=B4=20=D0=B8=20?= =?UTF-8?q?=D0=B4=D1=8D=D1=88=20=D1=81=D1=82=D0=BE=D0=BF=D0=B0=D1=8E=D1=82?= =?UTF-8?q?=D1=81=D1=8F=20=D0=BF=D0=BE=D1=81=D0=BB=D0=B5=20=D0=BA=D0=BE?= =?UTF-8?q?=D0=BB=D0=BB=D0=B8=D0=B7=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/CustomCharacterController.cs | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/Game/CourierOld/Assets/Code/Gameplay/Character/Controller/CustomCharacterController.cs b/Game/CourierOld/Assets/Code/Gameplay/Character/Controller/CustomCharacterController.cs index 98fed6c..95999ae 100644 --- a/Game/CourierOld/Assets/Code/Gameplay/Character/Controller/CustomCharacterController.cs +++ b/Game/CourierOld/Assets/Code/Gameplay/Character/Controller/CustomCharacterController.cs @@ -422,9 +422,23 @@ namespace Code.Gameplay.Character.Controller public void OnMovementHit(Collider hitCollider, Vector3 hitNormal, Vector3 hitPoint, ref HitStabilityReport hitStabilityReport) { - if (_wallRunningMechanic.TryStartWallRun(hitNormal, hitPoint)) - { - } + if (_wallRunningMechanic.TryStartWallRun(hitNormal, hitPoint)) return; + + var horizontalVelocity = Vector3.ProjectOnPlane(motor.Velocity, motor.CharacterUp).normalized; + var velocitySqrMag = horizontalVelocity.sqrMagnitude; + + if (!(velocitySqrMag > 0.01f)) return; + + var dot = Vector3.Dot(horizontalVelocity, hitNormal); + + const float impactThreshold = -0.3f; + + if (!(dot < impactThreshold)) return; + if (_dashMechanic.IsDashing) + _dashMechanic.EndDash(); + + if (_slideMechanic.IsSliding) + _slideMechanic.EndSlide(); } public void ProcessHitStabilityReport(Collider hitCollider, Vector3 hitNormal, Vector3 hitPoint,