Member Functions declared with override does not override a Base Class member?

Completely new to UE and C++ and currently stumped on why these two lines of code won’t override…
This code runs clean in 4.7.6 but in 4.9 it does not.

I’ve looked for answers here in the hub, Documentation and online and have found nothing that has worked so far.
If someone can point me in the right direction I would appreciate it.

Thanks in advance!

.h file

virtual void BlueprintUpdateAnimation(float DeltaTimeX) override;

virtual void BlueprintInitializeAnimation() override;	

.cpp file

void UCharacterAnimInstanceBase::BlueprintInitializeAnimation()
{
	Super::BlueprintInitializeAnimation();

	APawn* PawnOwner = this->TryGetPawnOwner();
	if (PawnOwner != NULL)
	{
		this->Character = Cast<ACharacterBase>(PawnOwner);
	}
}

void UCharacterAnimInstanceBase::BlueprintUpdateAnimation(float DeltaTimeX)
{
	Super::BlueprintUpdateAnimation(DeltaTimeX);

	if (this->Character != NULL)
	{
		this->bIsDead = this->Character->bIsDead;

		const FVector CharacterVelocity = this->Character->GetVelocity();
		this->Speed = CharacterVelocity.Size();

		const FRotator CharacterRotation = this->Character->GetActorRotation();
		this->Direction = this->CalculateDirection(CharacterVelocity, CharacterRotation);

		if (this->Character->EquippedWeapon != NULL)
		{
			this->WeaponType = this->Character->EquippedWeapon->WeaponType;
		}

		this->bIsAiming = this->Character->bIsAiming;
		this->bIsFiring = this->Character->bIsFiring;
		this->bIsReloading = this->Character->bIsReloading;
		this->Pitch = FMath::ClampAngle(this->Character->GetControlRotation().Pitch, -90.0f, 90.0f);

Thank you for the quick reply!

If you’re asking about what class it’s derived from that would be UAnimInstance
If you’re asking about something else can you elaborate a little more?

What does UCharacterAnimInstanceBase derive from?

Those functions do exist on UAnimInstance, but they’re not marked virtual so can’t be overridden.

It’s possible that this changed between 4.7.6 and 4.9, as someone went through and removed virtual from all functions marked as BlueprintImplementableEvent because the definition is expected to come from a BP, not C++.

/// This function is designed to be overridden by a blueprint.  Do not provide a body for this function;
/// the autogenerated code will include a thunk that calls ProcessEvent to execute the overridden body.
BlueprintImplementableEvent,

You’ll want to override and use NativeInitializeAnimation and NativeUpdateAnimation instead.

1 Like

That actually makes sense especially if it wasn’t originally operating as intended… so I will take a look at implementing this set up through the use of blueprints.

Thanks again

“You’ll want to override and use NativeInitializeAnimation and NativeUpdateAnimation instead.”

This absolutely worked thanks!!

void BlueprintUpdateAnimation(float DeltaTimeX) override;

 virtual void BlueprintInitializeAnimation(); 

Declare only function which overrride other are virtual or void