Gameplay Tag Container Not Updating

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.

However, inspecting the result of the second call shows it no longer there.

What is going on?

Add a delay prior to adding the first tag.

begin play → delay → add tags.

Unfortunately, no matter where I put a delay node it makes no difference.

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.

virtual void GetOwnedGameplayTags(FGameplayTagContainer& TagContainer) const override { TagContainer = GameplayTags; }

The only thing I can think of is that TagContainer = GameplayTags is actually preforming a copy. So I tried creating a function like this.

virtual FGameplayTagContainer& GetGameplayTags() override { return GameplayTags; }

This is definitely returning a reference, but the issue persists! I’m totally confused now.

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.