class

MGameplayAbility

Module
Game
Header
#include "Gameplay/MGameplayAbility.h"
Namespace
Mowo

Properties

TypeNameDescription
FGameplayTagabilityTagIdentity + gating. Set in the subclass constructor or by the granting code.
std::vector<FGameplayTag>activationRequiredTagsowner must have ALL
std::vector<FGameplayTag>activationBlockedTagsowner must have NONE
GameplayEffectSpeccostCost = an instant effect applied on commit (empty = free). Cooldown = a duration effect granting cooldownTag for cooldownDuration seconds.
FGameplayTagcooldownTag
floatcooldownDurationDefault 0.0f.
std::vector<FGameplayTag>activationCuesCues fired when the ability activates (OnActive) and ends (Removed).
std::vector<FGameplayTag>cancelAbilitiesWithTagUE's CancelAbilitiesWithTag / BlockAbilitiesWithTag / ActivationOwnedTags: on activation, end running abilities matching the first; while active, refuse abilities matching the second and give the owner the third.
std::vector<FGameplayTag>blockAbilitiesWithTag
std::vector<FGameplayTag>activationOwnedTags
std::vector<FGameplayTag>triggerEventTagsActivates the ability when a gameplay event with a matching tag is sent to the owner (UE's ability triggers). The event is in GetTriggerEventData() during ActivateAbility.

Constructors

SignatureNameDescription
MGameplayAbility() = defaultMGameplayAbility
virtual ~MGameplayAbility() = default~MGameplayAbility
MGameplayAbility(const MGameplayAbility&) = deleteMGameplayAbilityMove-only: owns latent tasks (unique_ptr) and is held by unique_ptr in the ASC.

Public functions

ReturnsNameDescription
MGameplayAbility&operator=
const FGameplayEventData&GetTriggerEventData
boolCanActivateCan the ability start right now? Checks required/blocked tags, the cooldown tag, and cost affordability.
voidActivateAbilityThe ability's logic.
voidEndAbilityTear down: cancels remaining tasks, clears the active flag, fires the Removed cues.
voidCommitCostPay the cost (instant effect) and start the cooldown (duration effect).
voidCommitCooldown
boolCommitAbility
boolIsActive
voidRequestEndAbilityA task (or the ability itself) asks to end.
boolConsumePendingEnd
voidTickAbilityDriven by the ASC each frame while active — ticks tasks, then prunes finished ones.
voidHandleGameplayEventDriven by the ASC when a gameplay event is sent while this ability is active — fans the event out to every live task.

Function details

MGameplayAbility

C++
MGameplayAbility() = default

~MGameplayAbility

C++
virtual ~MGameplayAbility() = default

MGameplayAbility

C++
MGameplayAbility(const MGameplayAbility&) = delete

Move-only: owns latent tasks (unique_ptr) and is held by unique_ptr in the ASC. Copying an in-flight ability makes no sense.

operator=

C++
MGameplayAbility& operator=(const MGameplayAbility&) = delete

GetTriggerEventData

C++
const FGameplayEventData& GetTriggerEventData() const

CanActivate

C++
virtual bool CanActivate(AbilitySystemComponent& asc) const

Can the ability start right now? Checks required/blocked tags, the cooldown tag, and cost affordability. Override to add bespoke checks (call the base first).

ActivateAbility

C++
virtual void ActivateAbility(AbilitySystemComponent& asc)

The ability's logic. Instant abilities do their work and return; latent abilities spawn tasks (AddTask) and end from a task's onFinished. Override this. Default ends immediately.

EndAbility

C++
virtual void EndAbility(AbilitySystemComponent& asc)

Tear down: cancels remaining tasks, clears the active flag, fires the Removed cues. Safe to call more than once. Override for cleanup (call the base last).

CommitCost

C++
void CommitCost(AbilitySystemComponent& asc)

Pay the cost (instant effect) and start the cooldown (duration effect). Split so an ability can commit cost on press and cooldown on release.

CommitCooldown

C++
void CommitCooldown(AbilitySystemComponent& asc)

CommitAbility

C++
bool CommitAbility(AbilitySystemComponent& asc)

IsActive

C++
bool IsActive() const

RequestEndAbility

C++
void RequestEndAbility()

A task (or the ability itself) asks to end. Deferred rather than immediate so EndAbility never clears the task list while the ASC is iterating it — the ASC drains the request after ticking / after routing an event.

ConsumePendingEnd

C++
bool ConsumePendingEnd()

TickAbility

C++
void TickAbility(AbilitySystemComponent& asc, float dt)

Driven by the ASC each frame while active — ticks tasks, then prunes finished ones.

HandleGameplayEvent

C++
void HandleGameplayEvent(const FGameplayEventData& data)

Driven by the ASC when a gameplay event is sent while this ability is active — fans the event out to every live task.

Generated from Gameplay/MGameplayAbility.h via game.json · Nov 5, 2026Version 1.0.0