Unreal Engine 4.x Scripting with C++ Cookbook - Second Edition
by John P. Doran, William Sherif, Stephen Whittle
How it works...
You must subclass and link in a set of UGameplayAbility objects to your actor's UAbilitySystemComponent object through a series of calls to UAbilitySystemComponent::GiveAbility( spec ) with appropriately constructed FGameplayAbilitySpec objects. What this does is deck out your actor with this bunch of GameplayAbilities. The functionality of each UGameplayAbility, as well as its cost, cooldown, and activation, is all neatly contained within the UGameplayAbility class derivative that you will construct.
Do not use the GameplayAbilitySet::GiveAbilities() member function because it doesn't give you access to the set of FGameplayAbilitySpecHandle objects that you actually need later to bind and invoke the ability to an input component. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access