Made wall-riding able to turn corners

Also changed air drag
This commit is contained in:
2025-03-28 14:29:03 +00:00
parent a972667fe4
commit 01e700a00e
5 changed files with 234 additions and 11 deletions

View File

@@ -18,14 +18,14 @@ public partial class PlayerMovement : MonoBehaviour
Vector3 vel = m_Body.velocity;
bool canSlide = !(Mathf.Abs(vel.x) < m_SlideRequiredSpeed && Mathf.Abs(vel.z) < m_SlideRequiredSpeed);
// Checks if the player is in the wall running state
if (GetNormalOfClosestCollider(out m_WallNormal) && m_WallRunKeyPressed)
{ m_State = PlayerState.WALL_RUNNING; }
// Checks if the player is in the wall riding state
else if (m_SlidingKeyPressed && (canSlide || m_OnSlope) && m_Grounded)
if (m_SlidingKeyPressed && (canSlide || m_OnSlope) && m_Grounded)
{ m_State = PlayerState.SLIDING; }
// Checks if the player is in the wall running state
else if (GetNormalOfClosestCollider(out m_WallNormal) && m_WallRunKeyPressed)
{ m_State = PlayerState.WALL_RUNNING; }
// Defaults to ruuning
else { m_State = PlayerState.RUNNING; }