if (bPressedSquat)
DesiredAnimation = SquatAnimation;
else {
DesiredAnimation = (PlayerSpeed > 0.0f) ? RunningAnimation : IdleAnimation;
}
GetSprite()->SetFlipbook(DesiredAnimation);
}
//////////////////////////////////////////////////////////////////////////
// Input
void AdicksCharacter::SetupPlayerInputComponent(class UInputComponent* InputComponent)
{
// Note: the 'Jump' action and the 'MoveRight' axis are bound to actual keys/buttons/sticks in DefaultInput.ini (editable from Project Settings..Input)
InputComponent->BindAction("Jump", IE_Pressed, this, &ACharacter::Jump);
InputComponent->BindAction("Jump", IE_Released, this, &ACharacter::StopJumping);
InputComponent->BindAxis("MoveRight", this, &AdicksCharacter::MoveRight);
InputComponent->BindAction("Squat", IE_Pressed, this, &AdicksCharacter::Squat);
InputComponent->BindAction("Squat", IE_Released, this, &AdicksCharacter::StopSquat);
}
void AdicksCharacter::Squat()
{
bPressedSquat = true;
}
void AdicksCharacter::StopSquat()
{
bPressedSquat = false;
}
I pretty much followed a tutorial line for line, but the character won’t squat when I press the button mapped to “Squat” what am I doing wrong? I’m using 4.7.6