Configure Combo and Weapon
This page folds a working melee or ranged hit into a combo: UGCS_ComboAbility only selects a row and advances ComboStep. Child abilities still perform the attack. The weapon actor supplies traces, a combo table, and an active state. SetCurrentWeapon only marks which weapon this action uses; it is not an equipment-bar swap.
Related pages: entity and weapon roles are in Combos, Weapons, and the Combat Entity. If a melee or ranged loop is not working yet, go back to Author a Melee Attack.
Prerequisites
- The pawn has a combat component and implements
IGCS_CombatEntityInterface. - You have at least two attack abilities that can activate on their own (for example light-attack step 1 and step 2).
- Those child abilities are already granted on the ASC.
UGCS_ComboAbilityskips rows whose ability class is not on the ASC. - You have an
AGCS_WeaponActorsubclass if you need weapon traces or a per-weapon table.
1. Author the combo table
Create a Data Table with row type FGCS_ComboDefinition. Two rows are enough:
Row | | | |
|---|---|---|---|
First hit | 0 | false | Light-attack ability A |
Second hit | 1 | false | Light-attack ability B |
Return to opener (optional) | 2 | true | Finisher or opener ability |
A row with MinComboStep 0 is eligible only at step 0. Non-resetting rows are skipped once the current step exceeds that gate. Fill EventTag, EventInstigatorTagQuery, or TagQuery when the row must filter on the event or owner tags.
2. Return the table from the entity
UGCS_ComboAbility reads GetComboDefinitionTable on the combat entity and logs an Error if the table is missing. Return null when the actor has no combo. With a current weapon, implementations usually forward that weapon's ComboDefinitionTable.
Do not advance the combo in an AnimBP state machine. Montages own animation windows and the attack requests on notifies. Step replication and row selection belong to ComboAbility and the combat component.
3. Use ComboAbility as the entry
Grant a UGCS_ComboAbility subclass as the entry ability:
- Input or a Gameplay Event activates ComboAbility.
StartCombo/AdvanceCombopick the first matching row for the currentComboStep, event tag, and tag queries.- The selected child ability activates; on success,
UpdateComboStepruns. The first hit moves the step to 1, the second to 2. - A selected row with
bResetComboStepandMinComboStep > 0resets the step to 0. When the child ends and there is no next step,ResetComboclears state.
The child ability runs the real HandleCollisionTraces or WaitForBulletEvent. Do not let the child change ComboStep unless you are deliberately extending that contract.
4. Configure the weapon actor
Subclass AGCS_WeaponActor and set:
Field | Role |
|---|---|
| Query and filter the weapon |
| Weapon traces created on the owner's Trace component when active |
| The combo table for this weapon |
| Header contract: when true, grant abilities listed in the combo table |
UGCS_ComboAbility only activates child abilities that already exist on the ASC. After you turn the flag on, still grant those abilities from your weapon-activation path or a GGA AbilitySet, or selection skips the rows.
Authority SetWeaponActive(true) replicates the active state and refreshes weapon traces. SetCurrentWeapon only marks which weapon the next action uses. Several weapons can be active at once; only one is the current-action weapon.
Expected result
Two light attacks move ComboStep from 0 to 1 to 2. The Debugger Combat section shows the step and combo table name. Stopping or hitting a reset row returns the step to 0. Changing the current-action weapon does not by itself change an equipment bar.
Verify
- The first entry-ability activation runs child ability A and
GetComboStepbecomes 1. - Advancing inside the window runs child ability B and the step becomes 2.
- After a reset row or ComboAbility end,
ResetComboStatereturns the step to 0 andOnComboStepChangedEventfires. - The Debugger Weapon section shows the current weapon, active state, and tags; the Trace section shows weapon handles after activation.
- The AnimBP has no combo-count variable. The step comes only from the combat component.
Common failures
Symptom | Check first |
|---|---|
ComboAbility ends immediately | Entity |
Always stuck on the first hit | Second-row |
Weapon mesh, no weapon Trace | Authority |
Wrong table after a weapon change | |
Combo authored in the AnimBP | The step will not replicate and Debugger ComboStep will not change. Move it back to ComboAbility |
Next
After combo and weapon are wired, confirm prediction versus authority in Debugging and Troubleshooting. Field detail is in Parameter Reference.