UAttributeSet::InitFromMetaDataTable
#include "AttributeSet.h"
Access: public
Specifiers: virtual
Description
Initializes every FGameplayAttributeData property on this set from a metadata DataTable, using each attribute's property name to look up a matching row.
Caveats & Gotchas
- • Row lookup is by exact property name, so the DataTable's row names must match your FGameplayAttributeData property names precisely (e.g. 'Health', not 'Health.BaseValue').
- • Only applies to properties that are FGameplayAttributeData; plain float attributes are skipped since they don't carry BaseValue/CurrentValue separately.
Signature
virtual void InitFromMetaDataTable(const UDataTable* DataTable) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| DataTable | const UDataTable* | A DataTable of FAttributeMetaData rows keyed by attribute name, providing base/min/max values. | — |
Return Type
void Example
Initialize attributes from a DataTable asset C++
void UMyHealthSet::PostInitProperties()
{
Super::PostInitProperties();
if (UDataTable* AttributeTable = LoadObject<UDataTable>(nullptr, TEXT("/Game/Data/DT_AttributeMetaData")))
{
InitFromMetaDataTable(AttributeTable);
}
} Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?