Stop Sprinting while crouching

Im quite new to Unreal and I have this problem. I looked at the other posts but I couldnt solve it. Here are my Blueprints, I can sprint and then when I crouch I cant sprint but after standing up I cant sprint anymore.

Any help is appreciated <3

Hey @Infinnium! Welcome to the forums!

I used your image and made some additions and corrections. This should get you where you need to go! :slight_smile:


Let us know if you have any issues!

We do this in code but I’m sure it will simplify your blueprints too. Keep variables “BaseMoveSpeed”, a “CrouchMultiplier”, and a “SprintMultiplier”.

  • Crouch key: toggles the CrouchMultiplier between 1 (not crouching) and .5 (crouching)
  • Sprint key: toggle the SprintMultiplier between 1 (not sprinting) and 1.5 (sprinting)
  • Move key: do a move using BaseMoveSpeed * CrouchMultiplier * SprintMultiplier

Then each key only does one simple thing and you don’t need all those switches. You can also crouch sprint.

Code is like this but should be simple in blueprint:

void AFirstPersonCharacter::MoveRight(float value)
{
	AddMovementInput(GetActorRightVector(), value * MOVE_RIGHT_RATE * _crouchMultiplier * _sprintMultiplier);
}

Thank you both very much <3

1 Like