I have this code for crouching in the shooter game:
void AShooterCharacter::OnBeginCrouch()
{
float NewEyeHeigh = BaseEyeHeight / 4;
bIsCrouched = true;
CrouchedEyeHeight = NewEyeHeigh;
RecalculateBaseEyeHeight();
}
void AShooterCharacter::OnStopCrouch()
{
bIsCrouched = false;
RecalculateBaseEyeHeight();
}
and I have this:
InputComponent->BindAction("BeginCrouch", IE_Pressed, this, &AShooterCharacter::OnBeginCrouch);
InputComponent->BindAction("StopCrouch", IE_Released, this, &AShooterCharacter::OnStopCrouch);
When I crouch the camera goes through the FPS Mesh. The camera moves but the FPS Mesh does not move.