I followed this tutorial to set up a c++ actor class that implements the IGameplayTagAssetInterface and returns a FGameplayTagContainer in GetOwnedGameplayTags. Works great and let’s me accss the gameplay tag container from blueprint and check what tags it has in it.
The problem I’m having is with adding and removing tags from the gameplay tag container at runtime. For some reason the gameplay tag container on the actor just doesn’t update with any tags that get added or removed. Take a look at the following blueprint.
You would expect both of those Print String nodes to print True right? But they don’t, they always print False, no matter what I do.
If I put a breakpoint in and inspect the contents of the gameplay tag container, take a look. Inspecting the result of the first call to GetOwnedGameplayTags shows the new tag successfully added.
So it appears as though any operation performed on a gameplay tag container returned by GetOwnedGameplayTags is NOT retained by the actor. It’s almost as if GetOwnedGameplayTags is returning a copy of the gameplay tag container instead of a reference, which doesn’t make any sense. Here is the code.
You would have to use the Add or Remove Loose Gameplay Tag functions instead and you will want to use the Has Tag check on the gameplay ability component of the actor instead of on the actor directly
I don’t see any nodes like that in my project? Are they specific to the gameplay ability system? If so, I’m not using that system. I’m just trying to use gameplay tags on their own.