Unable to find gameplay tags on actors

I’m confused about gameplay tags and why they won’t show up. I’ve created an actor along with a variable named GameplayTags that is a GameplayTagContainer. I have a component function running on overlap to check if the tag the colliding actor has is listed in the gameplay tag container I’ve passed in. The idea is to have a projectile that can only damage certain enemy types. So if I fire the projectile from an enemy I just say it can only hit heroes or maybe it can hit both heroes and enemies. For some reason no matter what I do the Has Any Matching Gameplay Tags blueprint always returns false.

Here is my component function trying to find the tag. I have been able to debug this and I can see that the actor has the GameplayTags variable and it’s set correctly. I can also see that the tag I’m searching for is in the Damaging Tags parameter.

Is there a different way to add a gameplay tag to an actor other than creating a new variable of the Gameplay Tag Container type? Is there another way of checking if my actor has the gameplay tag I’m looking for that I should be using?

Hey @evenflow58!

You can add tags directly to actors through actor’s Blueprints.

Hope this helps! :slight_smile:

Thanks! That worked. Is there a way to make them strongly typed on the actor? I don’t want to spend time trying to trouble shoot a typo.

you’d have to assign your GameplayTags to the Interface Functions you’re calling. i havent used that interface but usually

go to class settings, add interface GameplayTagAssetInterface and then you’ll find its functions in your function list

In case anybody stumbles on this: It looks like you can’t add GameplayTagAssetInterface to a blueprint for some reason. I had seen some older posts about this but they were from a few years ago and I had hoped the problem had been resolved or a work around had been found. Doesn’t seem like it. I ended up creating and implementing an interface with a HasTags function. Here is the implementation of that interface in a blueprint.

I then had to add a check for this interface along with calling the function in my component that checks if the colliding actor has the interface and then call the function. It’s not the cleanest implementation but given the desire to have strongly typed tags it’s the only/best way I found to accomplish this.

Thinking about this more a component that contains the tag variable and required functions seems to be cleaner implementation.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.