RealDocs

UAttributeSet::PostAttributeBaseChange

function GameplayAbilities Since unknown
#include "AttributeSet.h"
Access: public Specifiers: virtualconst

Description

Called just after an attribute's base value has changed when that attribute has an active aggregator. Use it to react to permanent value changes distinct from the temporary buffs tracked in the current value.

Caveats & Gotchas

  • Only fires for attributes with an active FAggregator; plain instant base-value changes never reach this callback.
  • Marked const like PreAttributeBaseChange, so it can only observe; any gameplay side effects belong in PostAttributeChange instead.

Signature

virtual void PostAttributeBaseChange(const FGameplayAttribute& Attribute, float OldValue, float NewValue) const { }

Parameters

Name Type Description Default
Attribute const FGameplayAttribute& The attribute whose base value changed.
OldValue float The base value before this change.
NewValue float The base value after this change.

Return Type

void

Example

Log MaxHealth base value changes C++
void UMyHealthSet::PostAttributeBaseChange(const FGameplayAttribute& Attribute, float OldValue, float NewValue) const
{
    if (Attribute == GetMaxHealthAttribute())
    {
        UE_LOG(LogTemp, Verbose, TEXT("MaxHealth base changed from %f to %f"), OldValue, NewValue);
    }
}

Version History

Introduced in: unknown

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.