How to use SetByCaller on Gameplay Effects?

Hi there,

I would rather store the cost of an ability as a variable on the ability itself, instead of creating a cost gameplay effect for each ability.

So I’d like to have one cost effect which I can change the magnitude based on the ability that applied the effect to the owner. It seems like I should use “SetByCaller” but I have no idea how to use it.

I found AssignSetByCallerMagnitude function in AbilitySystemBlueprintLibrary but where do I get the FGameplayEffectSpecHandle to pass into the function?

Any and all help appreciated.

Many thanks

Dann

1 Like

The first thing you want to do is create a Gameplay Tag for each Set by Caller Parameter. Then in your Gameplay Effect you pick that tag in the Set by Caller section. Then in your Gameplay Ability when you apply the Gameplay Effect you pass the value like this:

8 Likes