void AAuraEnemy::BeginPlay()
{
Super::BeginPlay();
InitAbilityActorInfo();
if (UAuraUserWidget* AuraUserWidget = Cast<UAuraUserWidget>(HealthBar->GetUserWidgetObject()))
{
AuraUserWidget->SetWidgetController(this);
}
if (const UAuraAttributeSet* AuraAS = Cast<UAuraAttributeSet>(AttributeSet))
{
AbilitySystemComponent->GetGameplayAttributeValueChangeDelegate(AuraAS->GetHealthAttribute()).AddLambda(
[this, AuraAS](const FOnAttributeChangeData& Data)
{
OnHealthChanged.Broadcast(Data.NewValue);
OnMaxHealthChanged.Broadcast(AuraAS->GetMaxHealth());
}
);
AbilitySystemComponent->GetGameplayAttributeValueChangeDelegate(AuraAS->GetMaxHealthAttribute()).AddLambda(
[this](const FOnAttributeChangeData& Data)
{
OnMaxHealthChanged.Broadcast(Data.NewValue);
}
);
OnHealthChanged.Broadcast(AuraAS->GetHealth());
OnMaxHealthChanged.Broadcast(AuraAS->GetMaxHealth());
}
}
OnMaxHealthChanged isnt being broadcast on clients? Ive checked all my code - the variable is definitely being replicated (the rep_notify is executed) and I have no typos. Any ideas?