UAttributeSet::OnAttributeAggregatorCreated
#include "AttributeSet.h"
Access: public
Specifiers: virtualconst
Description
Called when the ability system creates an FAggregator for one of this set's attributes, letting you customize the aggregator's EvaluationMetaData before it starts combining modifiers.
Caveats & Gotchas
- • Aggregators are created lazily the first time an attribute needs one (e.g. a duration-based effect targets it), not up front for every attribute.
- • Only covers aggregator creation; it isn't called for every later change to that aggregator (add/remove modifier, stacking, immunity), so don't treat it as a general change notification.
Signature
virtual void OnAttributeAggregatorCreated(const FGameplayAttribute& Attribute, FAggregator* NewAggregator) const { } Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| Attribute | const FGameplayAttribute& | The attribute the aggregator was created for. | — |
| NewAggregator | FAggregator* | The newly created aggregator instance backing that attribute. | — |
Return Type
void Example
Assign custom evaluation metadata for Armor C++
void UMyHealthSet::OnAttributeAggregatorCreated(const FGameplayAttribute& Attribute, FAggregator* NewAggregator) const
{
if (NewAggregator && Attribute == GetArmorAttribute())
{
NewAggregator->EvaluationMetaData = &ArmorEvaluationMetaData;
}
} See Also
Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?