UAttributeSet::GetAttributesFromSetClass
#include "AttributeSet.h"
Access: public
Specifiers: static
Description
Reflects over an AttributeSet subclass and appends an FGameplayAttribute for every FGameplayAttributeData or supported float property it declares.
Caveats & Gotchas
- • Appends to Attributes rather than emptying it first, so pass a fresh array if you don't want results from a previous call mixed in.
- • Only picks up properties FGameplayAttribute::IsSupportedProperty() recognizes; non-numeric properties on the set are silently skipped.
Signature
static void GetAttributesFromSetClass(const TSubclassOf<UAttributeSet>& AttributeSetClass, TArray<FGameplayAttribute>& Attributes) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| AttributeSetClass | const TSubclassOf<UAttributeSet>& | The AttributeSet subclass to reflect over. | — |
| Attributes | TArray<FGameplayAttribute>& | Output array that discovered FGameplayAttributes are appended to. | — |
Return Type
void Example
List all attributes on a set class C++
TArray<FGameplayAttribute> Attributes;
UAttributeSet::GetAttributesFromSetClass(UMyHealthSet::StaticClass(), Attributes);
for (const FGameplayAttribute& Attr : Attributes)
{
UE_LOG(LogTemp, Log, TEXT("Attribute: %s"), *Attr.GetName());
} See Also
Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?