Слайд и дэш стопаются после коллизий
This commit is contained in:
1 parent
5fc70e1db6
commit
a997a0682f
1 file changed
+17
-3
+17
-3
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user