diff --git a/code/pawn/PawnController.Util.cs b/code/pawn/PawnController.Util.cs index 4f762b9..a496696 100644 --- a/code/pawn/PawnController.Util.cs +++ b/code/pawn/PawnController.Util.cs @@ -47,7 +47,7 @@ void InitiateJumpOffWall() Entity.ApplyAbsoluteImpulse( jumpVector ); - previousWallrunSide = Wallrunning; + previousWallrunNormal = CurrentWall.Normal; Wallrunning = 0; } @@ -104,7 +104,7 @@ void InitiateLandingOnFloor() AddEvent( "grounded" ); Wallrunning = 0; - previousWallrunSide = 0; + previousWallrunNormal = Vector3.Zero; parkouredSinceJumping = false; parkouredBeforeLanding = false; diff --git a/code/pawn/PawnController.Wallrunning.cs b/code/pawn/PawnController.Wallrunning.cs index 083f5fd..c908d1c 100644 --- a/code/pawn/PawnController.Wallrunning.cs +++ b/code/pawn/PawnController.Wallrunning.cs @@ -40,7 +40,7 @@ void UpdateWallrunning() { Wallrunning = 0; wallrunSinceJumping = false; - previousWallrunSide = 0; + previousWallrunNormal = Vector3.Zero; } CurrentWall = traceWall.traceResult; @@ -87,7 +87,7 @@ bool TryWallrunning( ) var traceWall = CheckForWall(); - if ( CanWallrun( traceWall ) && previousWallrunSide != traceWall.side ) + if ( CanWallrun( traceWall ) && previousWallrunNormal != traceWall.traceResult.Normal ) { InitiateWallrun( traceWall ); @@ -109,7 +109,7 @@ void InitiateWallrun( WallRunTrace traceWall ) } Wallrunning = traceWall.side; - previousWallrunSide = traceWall.side; + previousWallrunNormal = traceWall.traceResult.Normal; wallrunSinceJumping = true; parkouredBeforeLanding = true; diff --git a/code/pawn/PawnController.cs b/code/pawn/PawnController.cs index 97609c0..8cd913c 100644 --- a/code/pawn/PawnController.cs +++ b/code/pawn/PawnController.cs @@ -46,7 +46,8 @@ public partial class PawnController : EntityComponent private bool debugMode => false; private bool parkouredSinceJumping = false; private bool wallrunSinceJumping = false; - private WallRunSide previousWallrunSide = WallRunSide.None; + // private WallRunSide previousWallrunSide = WallRunSide.None; + private Vector3 previousWallrunNormal = Vector3.Zero; private bool parkouredBeforeLanding = false; HashSet ControllerEvents = new( StringComparer.OrdinalIgnoreCase );