Apply Damage via SphereTrace to an enemy with GAS

I know it’s a dumb question but I’m really new to this system and trying a fast way to make this work so I can prototype:

The plan was to use a Sphere trace for object to apply damage like I always did, but since I’m willing to use GAS I thought I could simply use “ApplyGameplayEffectToTarget” and placing the “hit actor” as target for the GameplayEffect (the one that deals the damage), but that doesn’t works.

So please, how am I supposed to deal with this system?

Hey @BlueTitan99 how are you?

As you can see if you hover the “Target Data” pin in “ApplyGameplayEffectToTarget”, you need to connect the “Gameplay Ability Target Data Handle Structure” of your target to make it work.

You can obtain that from the “Hit Actor” in the “Hit Result” of your Sphere Trace.

You blueprint should look like this:

With that you should be able to apply any gameplay effect using the Sphere Trace.

Hope this helps you!

1 Like

ty so much, this works for what I need now

1 Like