Boxing Game Update 17 (05/02/24)


Today my focus was adding a character mesh and the appropriate animations.

Player CCP file

void ACompetitionCharacter::Punch()
{
...
State = "Punching";
if (WhichArm < 0.f)
{
FacingDirectionRight = false;
}
else
{
FacingDirectionRight = true;
...

I added a blueprint readable value named “FacingDirectionRight” that will tell the animation blueprint which animation should play. Also I replaced “PlayerState” with “State” as “PlayerState” already existed.

void ACompetitionCharacter::Retreat()
{
...
if (FacingDirectionRight == false)
{
FacingDirectionRight = true;
}
else
{
FacingDirectionRight = false;
...
void ACompetitionCharacter::KnockedDown()
{
...
SpringArm->TargetArmLength = 300;
SpringArm->SocketOffset = FVector(0, 0, 50);

Here the direction is swapped when the player retreats from dodging to play the appropriate animation. Also I zoomed the camera out once the player is knocked to show the full animation as it was clipping into the camera.

Player Anim Blueprint

State machine where the direction and “State” are checked for each animation change
Most entering transitions look like this
Most exiting transitions look like this
Notably once the dodges are completed, directional transitions are executed that play the opposite dodge animation so the player returns to the default position
Final punching anim result
Dodging anim result

Leave a Reply

Your email address will not be published.