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

@@ -31,7 +31,7 @@ public partial class PlayerMovement : MonoBehaviour
// Correctly applies force on slopes
if (m_OnSlope)
{
Vector3 slopeDir = m_SlopeHit.normal;
Vector3 slopeDir = m_StandingOn.normal;
slopeDir.y = 0.0f - slopeDir.y;
m_Body.AddForce(slopeDir.normalized * m_SlideSpeed * m_Body.mass * 10, ForceMode.Force);
}