Gameplay attributes are not clamped and have higher values internally.

Hi,

You can use PostGameplayEffectExecute function.

For example:

void UAuraAttributeSet::PostGameplayEffectExecute(const FGameplayEffectModCallbackData& Data)
{
if (Data.EvaluatedData.Attribute == GetHealthAttribute())
	{
		SetHealth(FMath::Clamp(GetHealth(), 0.f, GetMaxHealth()));
	}
	if (Data.EvaluatedData.Attribute == GetManaAttribute())
	{
		SetMana(FMath::Clamp(GetMana(), 0.f, GetMaxMana()));
	}
}

Note: you may want to keep PreAttributeChange or PostAttributeChange, no harm.

1 Like