File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Source/PBCharacterMovement/Private/Character Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -228,7 +228,7 @@ void APBPlayerCharacter::OnJumped_Implementation()
228228 if (JumpBoost != 1 )
229229 {
230230 // Only boost input in the direction of current movement axis.
231- Input *= FMath::Max (Input.GetSafeNormal2D () | GetCharacterMovement ()->Velocity .GetSafeNormal2D (), 0 .0f ) ;
231+ Input *= FMath::IsNearlyZero (Input.GetSafeNormal2D () | GetCharacterMovement ()->Velocity .GetSafeNormal2D ()) ? 0 .0f : 1 . 0f ;
232232 }
233233 const float ForwardSpeed = Input | Facing;
234234 // Adjust how much the boost is
@@ -247,7 +247,8 @@ void APBPlayerCharacter::OnJumped_Implementation()
247247 SpeedAddition -= NewSpeed - MaxBoostedSpeed;
248248 }
249249
250- if (ForwardSpeed < -MovementPtr->GetMaxAcceleration () * FMath::Sin (0 .6981f ))
250+ const float AccelMagnitude = GetCharacterMovement ()->GetCurrentAcceleration ().Size2D ();
251+ if (ForwardSpeed < -AccelMagnitude * FMath::Sin (0 .6981f ))
251252 {
252253 // Boost backwards if we're going backwards
253254 SpeedAddition *= -1 .0f ;
You can’t perform that action at this time.
0 commit comments