GSCGameplayAbility
provides the option to configure the ability to slightly changed how the resource cost for an ability is handled, by "loosely checking ability cost".
You might see in some games that, even if an ability has a set resource cost (for instance, Stamina), the ability can be triggered even if the stamina amount available at this moment is lower than the usual cost.
It can even result in negative values. From Dark Souls 3 wiki:
Stamina can go into negative values if you overuse your remaining stamina. This means that it will take longer for your stamina to recover to its maximum.
Setting the bLooselyCheckAbilityCost
property to true will allow the ability to activate even if the applied cost would go into negative values, and only prevented if the cost attribute(s) are at 0
or below.
By default, all attributes are clamped at 0
. If you want to have attributes that can go lower than that, this is something that needs to be done in PostGameplayEffectExecute
method in your Attribute Sets (in native c++), or alternately using Blueprint exposed event explained here.