Should be pretty simple right? wrong.
It’s not returning the actual value.
Got this in .h
UPROPERTY(BlueprintReadWrite, VisibleAnywhere);
USkeletalMeshComponent* SkeletalMeshInstance;
UPROPERTY(BlueprintReadWrite, VisibleAnywhere);
UAnimInstance* AnimationInstance;
This on construction
SkeletalMeshInstance = GetMesh();
this on begin play (because I doubt it would be initialized and set to an actual instance anytime before that).
if (SkeletalMeshInstance->HasValidAnimationInstance()) {
AnimationInstance = SkeletalMeshInstance->GetAnimInstance();
}
Now, if in BP I printstring AnimationInstance
I get NULL on BeginPlay
But I get the right result i’m looking for on EventTick
Suggestions on why this isn’t working @ begin play?
Does BP begin Play trigger prior to C++ begin play?
NOTE:
I’m doing it this way to create a master character class that doesn’t need to cast to specific animation instance to update it’s variables - if anyone has any better C++ alternatives to that please do share