---
title: Gameplay Attributes and Attribute Sets
source: https://dev.epicgames.com/documentation/en-us/unreal-engine/gameplay-attributes-and-attribute-sets-for-the-gameplay-ability-system-in-unreal-engine
version: Unreal Engine 5.8 Documentation
fetched: 2026-10-11
note: 原文摘录（英文），供 wiki 引用；非全文
---

# Gameplay Attributes and Attribute Sets

- FGameplayAttribute stores float values; stored in Attribute Set registered with ASC; handles clamping, temporary changes, base changes.
- Current vs base: Jump Height base 100, tired GE 70% → current 70; level up base 110 → current 77.
- Attributes without an Attribute Set are not recommended (no defined behaviors).
- Setup: UAttributeSet subclass with `FGameplayAttributeData` UProperties; store on Actor as `const UMyAttributeSet*` UPROPERTY; registered automatically when instantiated (constructor or BeginPlay, if GetAbilitySystemComponent valid), or Default Starting Data, or `ASC->GetSet<UMyAttributeSet>()`.
- An ASC can have multiple Attribute Sets, but each must be a different class.
- Applying a GE for an attribute the ASC lacks makes the ASC create a matching attribute, but no Attribute Set.
- Macros: GAMEPLAYATTRIBUTE_PROPERTY_GETTER, _VALUE_GETTER, _VALUE_SETTER, _VALUE_INITTER — best practice.
- Initialization via Data Table row type "AttributeMetaData" (csv: BaseValue, MinValue, MaxValue, DerivedAttributeInfo, bCanStack; name AttributeSetName.AttributeName, case-sensitive). MinValue/MaxValue have no effect — no built-in clamping.
- Control access in the Attribute Set (not by extending FGameplayAttributeData): custom getter returns Max(current,0); setter uses ASC->SetNumericAttributeBase so modifiers still work. GetGameplayAttributeValueChangeDelegate(...).AddUObject for change callbacks.
- PostGameplayEffectExecute override example clamps Health.
- Replication: ReplicatedUsing=OnRep_Health; OnRep_Health(const FGameplayAttributeData& Old) { GAMEPLAYATTRIBUTE_REPNOTIFY(...) }; DOREPLIFETIME_CONDITION_NOTIFY(UMyAttributeSet, Health, COND_None, REPNOTIFY_Always).
