Simple GAS Integration
Last updated
Last updated
Since I'm not highly experienced with the Gameplay Ability System (GAS), here's some progress on what I've done so far:
Create the Ability: First, I created the ability.
Set Up Variables in WB_SkillTreeSlot
: Inside WB_SkillTreeSlot
, I created two variables:
GASAbility
(Gameplay Ability Class Reference)
InstantActivate
(Boolean)
I also checked Instance Editable for both variables.
Modify the "OnAcquired" Event: Next, I opened the OnAcquired and OnUnlocked graph and navigated to the end of the OnAcquired event. Here’s the logic I added:
Check if GASAbility
is valid.
Get the player (I’m casting here as an example).
Retrieve the Ability System from the player.
Depending on your preference, call either Give Ability or Give Ability And Activate Once.
Promote the return value to a variable.
Branch the InstantActivate boolean.
If true, use Try Activate Ability.
Set Ability and Activation: After this, you can set the ability and decide if you want to activate it instantly.
Testing with a Simple Print: I added a simple print to my ability for testing purposes. ![Image7] But this should work for that part.
Clearing Abilities: Inside the AC_SkillTreeSystem
, within the Reset Skill function (at the end before the function finishes), you need to:
Get a reference to your character or ability system.
Call Clear Ability from the ability system.
Pass in the Ability Spec Handle
from the Skill Slot reference.
Since I don't have extensive knowledge of GAS, there may be some edge cases I haven’t covered. If you run into any issues, just let me know, and I’ll do my best to assist!