C++ Flipbook plays only first Sprite

I was working with C++ 2D SideScroller template. The character already had a chunk of code to update running animation which is working fine and looks like this:

void Aside2DcharCharacter::UpdateAnimation ()

{

const FVector PlayerVelocity = GetVelocity();
const float PlayerSpeed = PlayerVelocity.Size();

// Are we moving or standing still?
UPaperFlipbook* DesiredAnimation = (PlayerSpeed > 0.0f) ? RunningAnimation : IdleAnimation;;

if (GetSprite()->GetFlipbook() != DesiredAnimation)
	GetSprite()->SetFlipbook(DesiredAnimation);

}

I was going to implement jumping and falling animation that would check Z vector. Here is the code:

void Aside2DcharCharacter::UpdateJumpingAnimation()

{

const float TravelDirection = GetVelocity().Z;

// Set flipbook if character jumped
if (TravelDirection > 0.0f)
	GetSprite()->SetFlipbook(JumpingAnimation);

// Set flipbook if player falling
if (TravelDirection < 0.0f)
	GetSprite()->SetFlipbook(FallingAnimation);

}

It checks Z vector and updates the flip-book, so there are no problems with that. However, if my jumping and falling flip books have 10 sprites each, it plays only the first sprite from any flip-book all the time.
It seems like it doesn’t work because of GetVelocity().Z while PlayerVelocity.Size() creates no problems. All flip-books are fine because I already tested them by swapping with running flipbbok. Any suggestions?

I have figured out the problem. I was cheeking only X or only Z, but if the character was going both positive X and Z the flip books were overlapping because I didn’t have a statement to check the condition. Here is the updated code:

void Aside2DcharCharacter::UpdateAnimation()

{

const float PlayerSpeed = GetVelocity().X;
const float TravelDirection = GetVelocity().Z;

// Running animation if the character is moving only X axis but not Z axis
if (PlayerSpeed > 0.0f && TravelDirection == 0.0f || 
	PlayerSpeed < 0.0f && TravelDirection == 0.0f)
	GetSprite()->SetFlipbook(RunningAnimation);

// Jumping Animation if the character is jumping straight up or or together with any X axis
else if (TravelDirection > 0.0f || 
	TravelDirection > 0.0f && PlayerSpeed > 0.0f)
	GetSprite()->SetFlipbook(JumpingAnimation);

// Falling animation if the character is falling straight down or together with any X axis
else if (TravelDirection < 0.0f ||
	TravelDirection < 0.0f && PlayerSpeed < 0.0f)
	GetSprite()->SetFlipbook(FallingAnimation);

// Idle animation if the character neither is falling or jumping
else
	GetSprite()->SetFlipbook(IdleAnimation);

}