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);