Осталось пофиксить толка бак с камерай

This commit is contained in:
MrTorex committed 2025-11-14 15:02:33 +03:00
1 parent 0e1c274677
commit d1aad440f5
3 files changed
+13 -14

No files matched your search

@@ -54,6 +54,8 @@ namespace Code.Gameplay.Character.Controller.Abilities
// Проекция скорости на направление к стене (отрицательная, если летим в стену)
var velocityIntoWall = Vector3.Dot(currentVelocity, -hitNormal);
Debug.Log($"[TryClimbWall] velIntoWall={velocityIntoWall:F2}, min={_minWallClimbSpeed}, climbed={_hasClimbedThisWallSession}, cooldown={_wallClimbCooldownTimer:F2}");
// Если движемся в стену с достаточной скоростью
if (velocityIntoWall > _minWallClimbSpeed)
{
@@ -96,7 +96,6 @@ namespace Code.Gameplay.Character.Controller.Abilities
{
if (!_characterTransform) return;
var isGrounded = motor.GroundingStatus.IsStableOnGround;
var currentPosition = motor.TransientPosition;
var isStillNearWall = false;
@@ -109,19 +108,17 @@ namespace Code.Gameplay.Character.Controller.Abilities
if (_isLeaningOnWall)
{
switch (isGrounded)
var isBelowContactHeight = currentPosition.y < _lastWallContactHeight;
if (!isStillNearWall || isBelowContactHeight)
{
case true when !isStillNearWall:
case false when !isStillNearWall:
_isLeaningOnWall = false;
break;
default:
{
var heightDelta = currentPosition.y - _lastWallContactHeight;
var targetLeanFactor = Mathf.Clamp01(heightDelta * _heightScale);
_leanFactor = Mathf.Lerp(_leanFactor, targetLeanFactor, 1f - Mathf.Exp(-_leanSharpness * deltaTime));
break;
}
_isLeaningOnWall = false;
}
else
{
var heightDelta = currentPosition.y - _lastWallContactHeight;
var targetLeanFactor = Mathf.Clamp01(heightDelta * _heightScale);
_leanFactor = Mathf.Lerp(_leanFactor, targetLeanFactor, 1f - Mathf.Exp(-_leanSharpness * deltaTime));
}
}
@@ -366,7 +366,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!4 &678700802
Transform:
m_ObjectHideFlags: 0