Navigation
API > API/Plugins > API/Plugins/GameplayAbilities > API/Plugins/GameplayAbilities/UAbilitySystemComponent
Description
Grants a Gameplay Ability and returns its handle. This will be ignored if the actor is not authoritative.
| Name | K2_GiveAbility |
| Type | function |
| Header File | /Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Public/AbilitySystemComponent.h |
| Include Path | #include "AbilitySystemComponent.h" |
| Source | /Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Private/AbilitySystemComponent_Abilities.cpp |
UFUNCTION (BlueprintCallable, BlueprintAuthorityOnly, Category="Gameplay Abilities",
Meta=(DisplayName="Give Ability", ScriptName="GiveAbility"))
FGameplayAbilitySpecHandle K2_GiveAbility
(
TSubclassOf < UGameplayAbility > AbilityClass,
int32 Level,
int32 InputID
)
Parameters
| Name | Remarks |
|---|---|
| AbilityClass | Type of ability to grant |
| Level | Level to grant the ability at |
| InputID | Input ID value to bind ability activation to. |