I have read a couple other post about getting crouch to work. I followed what the others did however it seems the Crouch(); function in Character.h doesn’t do anything. Below are my code snippets.
Thanks!
AShooterCharacter.cpp file
InputComponent->BindAction("Crouch", IE_Pressed, this, &AShooterCharacter::StartCrouch);
InputComponent->BindAction("Crouch", IE_Released, this, &AShooterCharacter::StopCrouch);
void AShooterCharacter::StartCrouch()
{
Crouch();
}
void AShooterCharacter::StopCrouch()
{
UnCrouch();
}
AShooterCharacter.h
/** player pressed crouch action */
void StartCrouch();
/** player released crouch action */
void StopCrouch();