Hi,
I’ve created a separate ActorComponent in C++ (to handle attack animations).
I’m trynna set a sequence of animation montages to perform (as an array) in the Editor, which I can hopefully then refer inside C++ to play those montages.
I’ve declared the TArray like so:
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Sword Attacks", meta=(AllowPrivateAccess="true"))
TArray<class UAnimMontage*> SwordAttackMontages;
And just as expected, I assign these references in the Editor panel of my ActorComponent like this:
I’ve created a Blueprint Native Event called “SwordAttack” that gets called when I press the left mouse button basically.
void URPG_Attack_System::SwordAttack_Implementation() {
// Safety checks:
if (SwordAttackMontages.IsEmpty()) {
UE_LOG(LogTemp, Warning, TEXT(" >> No Sword Attack Anim Montages added to list"));
return;
}
// do something after this...
}
For some reason, it keeps saying that the Array of montages is empty, even though I’ve set them in the editor…Am I missing something? I couldn’t quite figure out what’s causing this.