Attach Combat Components
This page wires one combat pawn into GCS: finish InitializeAbilitySystem from the GenericGameplayAbilities docs on the authority, attach the combat components, and implement IGCS_CombatEntityInterface. When you are done, the Debugger Shared section shows the components and the interface. This page does not fire an attack.
Related pages: layering is in System Boundaries; Flow and results are in Combat Flow and Attack Results.
Prerequisites
- You enabled
GenericCombatSystemand its.uplugindependencies from Quick Start. GIPS owns input buffering and is not a module dependency of this plugin. - You pointed Ability System Globals at
UGGA_AbilitySystemGlobalsand calledInitializeAbilitySystemon the authority, following the GGA docs. This page names those docs and does not link to another plugin path. - You have a combat pawn the server can spawn. GCS does not require a specific character base class. The actor or a component only needs the interface.
- You have an instantiable
UGCS_CombatFlowsubclass (the base class is Abstract) with at least one processor. How to override it and wire the GGA callback is in Register the First Attack Result.
1. Confirm the Ability System first
Before any GCS component, the authoritative pawn already has a usable GGA Ability System Component. Combat Flow turns GGA attribute callbacks and Effect Context payloads into FGCS_AttackResult. If the ASC is not initialized, later hits and Gameplay Effects never enter Flow as expected.
2. Attach the minimum set
On each pawn that fights:
- Add
UGCS_CombatSystemComponentand setCombatFlowClass. AuthorityBeginPlayNewObjects that class and replicates the Flow, so the abstract base class cannot be used. - Add
UGCS_TraceSystemComponentfor melee. The Trace Subsystem ticks the sweeps; the component owns handles and hit events. - Add
UGCS_BulletSystemComponentfor ranged. It owns replicated bullet entries, instances, and the prediction contract. - Add
UGCS_TargetingSystemComponentandUGCS_CombatTeamAgentComponentwhen lock-on or affiliation filters matter. Targeting can live on a non-pawn actor; the team component replicatesFGenericTeamId. - Implement
IGCS_CombatEntityInterfaceon the actor or one of its components. Return at least the current target, death state, current weapon, and combo table (or null when unused).
If actions are chosen by tags, author UGCS_AbilityActionSetSettings as a DataAsset. It is not a project settings class. The entity's QueryAbilityActionsByContext reads that asset.
3. Implement the smallest interface returns
The interface can live on the actor or a component. UGCS_CombatFunctionLibrary::GetCombatEntityInterface / FindCombatInterface check the actor first, then components that implement the interface.
Suggested minimum:
Function | This page |
|---|---|
| Forward |
| Return your project's death flag; return false until you have one |
| Remember the weapon for this action; do not switch an equipment bar here |
| Return null with no combo; with a weapon, typically forward the weapon table |
Leave rotation, movement-set, and death flow empty until the combo and weapon page.
Expected result
After authoritative PIE, the pawn has a combat component and an instanced Combat Flow. Blueprint Get Combat System Component / Find Combat System Component succeed. The Debugger Shared section marks the combat-entity interface as present.
Verify
UGCS_CombatSystemComponent::GetCombatSystemComponent/FindCombatSystemComponentare non-null.- Melee pawns resolve
GetTraceSystemComponent/FindTraceSystemComponent; ranged pawns also resolveGetBulletSystemComponent/FindBulletSystemComponent. - Lock-on pawns resolve
GetTargetingSystemComponent; team pawns return a team throughGetCombatTeamAgentInterface. - Open the Combat category of Gameplay Debugger (registered at module startup as
GenericCombatSystem): Shared shows the combat component, Combat Flow, and the combat-entity interface. - The Flow processor list is not empty.
Common failures
Symptom | Check first |
|---|---|
GCS components missing in Blueprint | Plugin and dependencies enabled; project compiled, then editor restarted |
Combat Flow stays None | |
Shared has no combat-entity interface | Interface on the actor or component that lookup uses; Blueprint compiled |
Later hits produce no Attack Result | Authority called |
Client shows the component, server has no Flow | Flow is created on the authority. Check the server window first |
Next
Once lookup works, make Combat Flow produce a Result with Register the First Attack Result. Then melee is Author a Melee Attack and ranged is Author a Ranged Attack.