How-To: Use Toggle, Charges and Channeling

Goal: pick the right shipped ability shape instead of re-implementing it.

Prerequisites
Quick Start.

Toggle

UCrimsonGameplayAbility_Toggle stays active until the input is pressed again. Use it for stances, auras and sustained modes.

Toggle abilities must handle both input edges
An ability that remains active across presses has to override InputPressed / InputReleased to see the second press - the default activation path only fires once. The shipped subclass already does this; a hand-rolled one usually does not.

Charges

UCrimsonGameplayAbility_Charges holds N uses that refill over time. Read state with Get Max Charges and Get Current Charges; activation fails with Ability.ActivateFail.Charge.OutOfCharges when empty.

Bind a UI widget to Get Current Charges and listen for Ability.ActivateFail.Charge.OutOfCharges to flash the button.

Channeling

UCrimsonGameplayAbility_Channeling ticks at an interval while held and can break on movement.

FunctionDoes
Start Channeling / Stop ChannelingBegin and end the channel explicitly.
Set Channel Tick IntervalHow often the channel ticks.
Set Max Channel TimeHard cap on the channel duration.
Set Cancel On MovementBreak the channel if the avatar moves.
Verify
Channel, then move. With Cancel On Movement set, the ability ends and Ability.State.Channeling is removed.

See also

  • How-To: Make a Cast-Time Ability
  • Concept: Ability Subclasses