RealDocs

UAttributeSet::PreGameplayEffectExecute

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

Description

Called immediately before a GameplayEffect execution modifies an attribute's base value, giving the AttributeSet a chance to inspect or reject the change. Return false to throw out the modification entirely.

Caveats & Gotchas

  • Only fires for 'execute' modifications (instant effects), not for duration-based effects that apply their magnitude through an aggregator; use PreAttributeChange for those.
  • Data.EvaluatedData.Magnitude can be modified in place before returning true, letting you clamp or rescale the incoming change.

Signature

virtual bool PreGameplayEffectExecute(struct FGameplayEffectModCallbackData &Data) { return true; }

Parameters

Name Type Description Default
Data FGameplayEffectModCallbackData& Callback context describing the effect execution in progress, including the target attribute and evaluated magnitude.

Return Type

bool

Example

Reject negative damage C++
bool UMyHealthSet::PreGameplayEffectExecute(FGameplayEffectModCallbackData& Data)
{
    if (Data.EvaluatedData.Attribute == GetDamageAttribute() && Data.EvaluatedData.Magnitude < 0.f)
    {
        return false;
    }
    return true;
}

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.