How-To: Make a Cast-Time Ability

Goal: build an ability that shows a cast bar, then delivers its effect when the cast finishes - using UCrimsonGameplayAbility_WithCastTime.

Prerequisites
Quick Start complete. You know which input tag will trigger the ability.

1. Subclass the cast-time ability

Screenshot pendingImages/CrimsonAbilitySystem/howto-casttime-subclass.png
Create a Blueprint child of UCrimsonGameplayAbility_WithCastTime.

Implement the cast lifecycle events in the event graph: K2_OnCastStarted, K2_OnCastCompleted, K2_OnCastInterrupted.

EventWhen called
K2_OnCastStarted(TotalCastTime)Cast timer begins - start the montage / UI bar
K2_OnCastCompleted()Cast finished without interruption - deliver the effect here
K2_OnCastInterrupted()Cancelled, or the pawn moved past the threshold

2. Configure cancellation and commit timing

  • Set bCancelOnMovement = true and MovementCancelThreshold (cm) to auto-interrupt when the caster moves.
  • Set CommitTime to OnCastCompleted so a cancelled cast costs nothing (no cooldown, no resource spend).
  • Override GetCastSpeedModifier() in your game subclass to scale cast time from an attribute (returns 1.0 by default).
Verify
Activate the ability in PIE: the cast bar plays, moving cancels it (if enabled), and the effect only lands on completion. A cancelled cast applies no cooldown when CommitTime = OnCastCompleted.

See also

  • Concept: Gameplay Ability - activation policy, commit time, costs
  • Concept: Ability Contract - where CastTime comes from