This class is very crucial for any game utilising the Gameplay Ability System (GAS). I recommend every serious game make their own subclass of this. This class is responsible for setting up the core GAS stuff, below i provide a couple of reasons why you would and should create your own.
- Allows you initialise global tags which can be used in native code.
- Allows you to change what stuff get gets initialised into GameplayCue Parameters.
- Allows you to change what class you want to use for AttributeSet Initter.
- Allows you to change what class your EffectContext uses.
- Allows you to change what class your AbilityActorInfo uses.
There are also many more reasons, but these are the most common ones. With that in mind, let us go creating and setting up our own custom UAbilitySystemGlobals for our project.
In the unreal editor, you need to create your AbilitySystemGlobals class for your game,
Once you have your new class, we now need to set it in your DefaultGame.ini so go ahead and open that and add the following lines to it. Taking note to use your Game Module name and Class name without the U.
[/Script/GameplayAbilities.AbilitySystemGlobals]
+AbilitySystemGlobalsClassName="/Script/Kaos.KaosAbilitySystemGlobals"
Where Kaos is your game module name, and KaosAbilitySystemGlobals is the class without the U. I.E if your project is ShooterGame and your class was USGAbilitySystemGlobals, then the above would be
/Script/ShooterGame.SGAbilitySystemGlobals
With that done, rebooting the engine will now load your own Game Specific Ability System Globals class.