Where to pass info to an Gameplay Ability?

Hi guys,
I’m currently rewriting my projects logic to use GAS, and now I’ve a small question about passing custom Information to an ability.
I’ve read the wiki and searched the ARPG example source code but cannot find the correct place to pass a custom UObject (or struct)…

Some Abilities fire projectiles from multiple Sockets from multiple UStaticMeshComponents of a pawn.
Therefore I need to pass a list (an UObject or preferably an UStruct if possible) containing the UStaticMeshComponent pointers plus their socket names.
This info does not change after it’s set, so just pass that info once at granting/creation time and set the corresponding variables inside the gameplay ability.

Because those variables of the ability need to be set dynamically the ability’s instantiation policy is set to instance per actor. (If I understood it right, that must be done for my purpose)
And I don’t think passing a custom UObject as “SourceObject” in “GrantAbility” is the correct place. - Or is it?

I’d appreciate it if you can point me in the right direction.

have your figured this out? I also wan to pass custom data through GameplayEventData payload, like things that swap slots or purchase item from a merchant

There is some kind of mechanism to pass data through the effect info, but I end up instead just getting the invoking actor info (which is the parent of the ASC,) and groping through that actor to find things with the right socket names. And if those things aren’t there, logging an error message.

So, instead of “actor passes information to ability,” my logic is now “ability, when invoked, finds the actor and gets the information.”

2 Likes