Boxing Game update 18 (06/02/24)


Today I worked on adding the recovery animation for my character.

Character CPP file

void ACompetitionCharacter::CheckSequence()
{
State = "Recovering";
GetWorldTimerManager().SetTimer(RecoveryHandle, this, &ACompetitionCharacter::Recovery, 3.0f, false);
...
void ACompetitionCharacter::Recovery()
{
//reset values
State = "Inactive";
SpringArm->TargetArmLength = 100;
SpringArm->SocketOffset = FVector(0, 0, 50);
health = 100;
SetActorLocation(GetActorLocation() + FVector(100, 0, 0));
RandomisedArray.Empty();
SequenceArray.Empty();
SequencePosition = 0;

Here I added a recovery function and moved the code within the “CheckSequence” function so I can control when the recovery takes place. Now, during the recovery timer, the animation will play within the animation blueprint.

Animation Blueprint

Shows how the animation state changes
Transition condition
Knocked Out anim (taken from later build)
Recovery anim (taken from later build)

Leave a Reply

Your email address will not be published.