Changed how slope detection works

There is a bug with the camera
This commit is contained in:
Pasha Bibko
2025-03-30 17:26:31 +01:00
parent 86acfab81d
commit 8610868924
7 changed files with 129 additions and 91 deletions

View File

@@ -28,7 +28,7 @@ public partial class PlayerMovement : MonoBehaviour
if (m_OnSlope)
{
// Calculates better move direction for sliding
m_MoveDir = Vector3.ProjectOnPlane(m_MoveDir, m_SlopeHit.normal).normalized;
m_MoveDir = Vector3.ProjectOnPlane(m_MoveDir, m_StandingOn.normal).normalized;
}
// Runs correct update function depending on player state