From 00cee0171a96c00028e1500956739446e7494be9 Mon Sep 17 00:00:00 2001 From: Selim Nahimi Date: Sat, 2 Sep 2023 00:49:31 +0200 Subject: [PATCH] Updated movement logic - Landing was not being detected properly, thats fixed now - Wallrunning now doesn't activate when it shouldn't --- code/pawn/PawnController.Wallrunning.cs | 3 +++ code/pawn/PawnController.cs | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/code/pawn/PawnController.Wallrunning.cs b/code/pawn/PawnController.Wallrunning.cs index ffdbd72..fd4d3ef 100644 --- a/code/pawn/PawnController.Wallrunning.cs +++ b/code/pawn/PawnController.Wallrunning.cs @@ -68,6 +68,9 @@ bool CanWallrun( WallRunTrace traceWall ) if ( Wallrunning == WallRunSide.Right && traceWall.side != WallRunSide.Right ) return false; + if ( !IsWallRunning() && (Entity.Velocity * 0.5f).WithZ( 0 ).Length < 100f ) + return false; + if ( IsWallRunning() && Entity.Velocity.WithZ( 0 ).Length < 100f ) return false; diff --git a/code/pawn/PawnController.cs b/code/pawn/PawnController.cs index dedd53e..fb3683e 100644 --- a/code/pawn/PawnController.cs +++ b/code/pawn/PawnController.cs @@ -7,7 +7,7 @@ namespace RunnerVision; public partial class PawnController : EntityComponent { public int StepSize => 26; - public int GroundAngle => 100; + public int GroundAngle => 200; public int JumpSpeed => 300; public float Gravity => 800f; public float StartingSpeed => 1000f; @@ -87,7 +87,6 @@ public void Simulate( IClient cl ) UpdateMaxSpeed( moveVector ); AdjustSharpTurn( moveVector ); - UpdateMoveHelper( groundEntity ); if ( groundEntity.IsValid() ) { @@ -96,6 +95,12 @@ public void Simulate( IClient cl ) InitiateLandingOnFloor(); } + } + + UpdateMoveHelper( groundEntity ); + + if (Grounded) + { DoMovement( moveVector ); } else