Frequently Asked Questions¶
Setup and Initialization¶
I get crashes on ability activation. What is wrong?¶
The most common cause is forgetting to call UAbilitySystemGlobals::Get().InitGlobalData() during game initialization. Add this call to your UGameInstance::Init() override.
Where should the ASC live -- on the Pawn or the Player State?¶
Both patterns are supported:
| Pattern | ASC Location | Use When |
|---|---|---|
| Pawn-based | On the Character/Pawn | Simple setup, abilities reset on death, no persistence needed. |
| Player State-based | On the Player State | Abilities and attributes persist across respawns. Recommended for multiplayer. |
For Player State-based ASC:
- Use
AFWModularPlayerState(or subclass) to hold the ASC. - Use
AFWModularPlayerStateCharacterfor the pawn. - Set
bResetAbilitiesOnSpawn = falseandbResetAttributesOnSpawn = falseon the ASC.
When does InitAbilityActorInfo fire?¶
Multiple times during the actor's lifecycle:
- Server: after component initialization.
- Server: after owning actor replication (e.g., Possessed By for Player State).
- Client: after component initialization.
- Client: after owning actor replication (e.g., OnRep_PlayerState).
The OnInitAbilityActorInfo event on both the ASC and Core Component fires after each call. Design your initialization logic to be idempotent.
Input Binding¶
How does Enhanced Input binding work with GAS?¶
The flow is:
- You configure
FFWAbilityInputMappingwith anInputActionandTriggerEvent. - When the ASC grants the ability, it finds the
UFWAbilityInputBindingComponenton the avatar actor. - The binding component registers an Enhanced Input callback for the specified Input Action.
- When the Input Action fires, it calls
AbilityLocalInputPressed()on the ASC with the ability'sInputID. - The ASC attempts to activate the bound ability.
My input binding is not working. What should I check?¶
Checklist:
- The character has a
UFWAbilityInputBindingComponent. - The
InputActionasset is valid and added to an active Input Mapping Context. - The ability is actually granted (check with
showdebug abilitysystem). - The
TriggerEventmatches the Input Action's trigger configuration. - For Player State ASCs,
bResetAbilitiesOnSpawnisfalse(prevents duplicate bindings).
Can I change input bindings at runtime?¶
Yes. Call SetInputBinding() on the UFWAbilityInputBindingComponent with a new Input Action and the ability's FGameplayAbilitySpecHandle. Call ClearInputBinding() to remove a binding.
Ability Sets¶
What is the difference between GrantedAbilities on the ASC and an AbilitySet?¶
| Feature | ASC GrantedAbilities | AbilitySet DataAsset |
|---|---|---|
| Configuration | Directly on the component | Separate DataAsset |
| Reusability | Per-component | Shared across actors |
| Runtime grant/remove | Manual | Handle-based lifecycle |
| Content separation | Tightly coupled | Loosely coupled |
| GameFeature support | Limited | Full support |
AbilitySets are recommended for most use cases. Use direct ASC granting only for simple prototyping or abilities that are truly per-actor.
Can I grant the same AbilitySet multiple times?¶
The ASC tracks granted sets and prevents duplicate granting via ShouldGrantAbilitySet(). If the set is already granted, the method returns without re-granting.
How do I remove an AbilitySet at runtime?¶
Use the handle returned from GiveAbilitySet():
FFWAbilitySetHandle CombatHandle;
ASC->GiveAbilitySet(CombatSet, CombatHandle);
// Later, to remove:
ASC->ClearAbilitySet(CombatHandle);
Combo System¶
How does the combo chain work?¶
The flow for a three-hit combo:
- Player presses attack. ASC activates
GA_MeleeCombo. Combo index is 0. MontageAM_Slash1plays. - During
AM_Slash1, theFWComboWindowNotifyStateopens the combo window. - Player presses attack during the open window. The
UFWComboManagerComponentdetects this and setsbShouldTriggerCombo = true. - The
FWTriggerComboNotifyfires, activating the next combo ability. Combo index increments to 1.AM_Slash2plays. - Repeat for the third hit.
- After the final montage ends (or if the window closes without input),
ResetCombo()is called.
My combo is not chaining. What should I check?¶
Checklist:
- The character has a
UFWComboManagerComponent. - The montages have
FWComboWindowNotifyStatenotify states at the correct positions. - The montages have
FWTriggerComboNotifyinstant notifies within the combo window. - The
ComboMontagesarray on the ability is populated with montages in order. - The ability has
InstancingPolicy = InstancedPerActor(required for combo state tracking).
Can combos work in multiplayer?¶
Yes. The UFWComboManagerComponent uses replicated properties and Server/Multicast RPCs:
ComboIndex,bComboWindowOpened,bShouldTriggerComboare replicated.ServerActivateComboAbilityandMulticastActivateComboAbilityRPCs handle authority routing.ServerSetComboIndexandMulticastSetComboIndexRPCs synchronize the counter.
Ability Queue¶
When should I use ability queuing vs. combo chaining?¶
| System | Purpose | Example |
|---|---|---|
| Combo | Chain the same ability into a multi-step sequence. | Three-hit melee combo. |
| Queue | Buffer a different ability to activate after the current one ends. | Queue a dodge roll during an attack animation. |
Both systems can be active simultaneously on the same character.
How do I configure what abilities can be queued?¶
Use UpdateAllowedAbilitiesForAbilityQueue() on the UFWAbilityQueueComponent. Pass an array of allowed ability classes. Alternatively, call SetAllowAllAbilitiesForAbilityQueue(true) to allow any ability.
The FWAbilityQueueNotifyState in montages can also specify allowed abilities per animation window.
Attributes¶
How does the Damage meta attribute work?¶
Damage is a server-only, non-replicated attribute. The flow:
- A
UGameplayEffectmodifiesFWAttributeSet.Damage(e.g., +25). PostGameplayEffectExecutefires on the server.- The attribute set reads the
Damagevalue, subtracts it fromHealth, and resetsDamageto 0. - If Health reaches 0, it fires the death event via
UFWGASCoreComponent::Die(). - The Health change replicates to clients via
OnRep_Health.
This pattern ensures damage calculations are server-authoritative while the visual result (health change) replicates efficiently.
How do I add custom attributes?¶
Create a new class inheriting from UFWAttributeSetBase:
UCLASS()
class UMyCustomAttributes : public UFWAttributeSetBase
{
GENERATED_BODY()
public:
UPROPERTY(BlueprintReadOnly, ReplicatedUsing = OnRep_Luck)
FGameplayAttributeData Luck;
ATTRIBUTE_ACCESSORS(UMyCustomAttributes, Luck)
protected:
UFUNCTION()
void OnRep_Luck(const FGameplayAttributeData& OldValue);
};
Add it to the GrantedAttributes on the ASC or in an AbilitySet.
Why are my attribute initial values zero?¶
Either:
- You did not provide an
InitializationDataDataTable. - The DataTable row names do not match the attribute names.
- The DataTable row structure is not
AttributeMetaData.
GameFeature Actions¶
What happens when a GameFeature is deactivated?¶
The UFWGameFeatureAction_AddAbilities action tracks all granted abilities, attributes, effects, and ability sets per actor. When the feature deactivates, it calls the corresponding remove methods for each, cleanly tearing down everything that was granted.
Can I use GameFeature actions with Player State ASCs?¶
Yes, but the ActorClass should be set to your Player State class (not the Pawn), since that is where the ASC lives.
Performance¶
Are there performance concerns with many ability grants?¶
The initial grant during InitAbilityActorInfo iterates through all GrantedAbilities, GrantedAttributes, GrantedEffects, and GrantedAbilitySets. For characters with dozens of abilities, this is still fast (sub-millisecond). AbilitySets are loaded asynchronously via soft references, so they do not block the main thread.
Does the combo system add replication overhead?¶
The combo manager replicates five boolean/integer properties and uses reliable RPCs for activation. The overhead is minimal -- comparable to a single replicated actor component.