GAS: Gameplay Effect doesn't remove its tag after has duration

Hello guys,
I’m working on a multiplayer based melee combat game and using the gameplay ability system for it. I’m really new to this system and a full documentation seems rare.
Now to my problem: My Characters can do a blocking ability. This ability plays an gameplay effect which adds a gameplay tag (skill.blocking.isBlocking)to the owner, so that the melee attacking ability can react diffrent to an blocking enemy. Works fine and is replicated to everyone. In addition I’m playing a second ability “PerfectBlock” with the Blocking Ability, which adds another gameplayeffect (skill.blocking.perfectblock) to its owner. But this gameplay effect should have a duration. So I set it for testing to 5 seconds.
Now the creepy things happens: When I test my game and one player is attacking another, who has startet the blocking and perfect blocking ability first,(within the has duration time) the melee attack is reacting to the tags as expected. My Attack is reacting to the perfect block and knows that the enemy is doing a perfect block. But after that “has duration” time of the perfectblock effect the attacker is still getting both tags on its target, allthough it only should had the blocking tag without the perfectblock tag. So I testet it with the Gameplay Debugger, the creepy thing is, here the tags are totally correct. My PerfectBlock Tag is always removed after its duration like it should be.
Here a few pictures for better understanding: The GameplayEffect Perfectblock.

GameplayAbility Melee: Here the magic happens. After playing my attacking montage i’m waiting for a gameplay event with my target information (if hitted).

This is the notify triggered by my attacking montage. For now i’m doing a trace to check for enemies in front of me. The blue edged for loop was just for my testing and it’s shoing that here the problem begins, because since here the tags aren’t removed like expected and then sendet to my ability.
PS: I’ve done another test: When a player starts the blocking abilities, and i’m waiting and not attacking this enemy until the perefect block shouldn’t exist anymore, it really doenst exist anymore. The attacker is only getting the isblocking tag and reacting to it, not the perfect block anymore. And as said above, when i switch the situation and attack the enemy whithin the perfect block time, i’m reacting to the perfect block. After that time, the perfect block isn’t removed. That’s the point i’m totally out with my ideas for it.
Hopefully you understand my english.
Greetings from germany, Marco
I really have no idea what the problem is. I hope someone can help me.

Sorry I really don’t get it. That’s what I found about GameplayEffectTags on Github. In my understanding, this means that the GameplayEffect itself uses its duration policy to add / remove these granted tags. That should mean if I set up a gameplayeffect with the duration policy: Has Duration, it should work or not?

[TABLE=“class: text_table”]

Granted Tags
Tags that live on the GameplayEffect but are also given to the ASC that the GameplayEffect is applied to. They are removed from the ASC when the GameplayEffect is removed. This only works for Duration and Infinite GameplayEffects.

I believe you should check the Target (Actor) has the tag, not the TargetTags.

Do not do that in blueprints!

	FGameplayTagContainer myTags;
	for (const FGameplayTag& Tag : myTags)
		GEngine->AddOnScreenDebugMessage(-1, 0.0f, FColor::Red, FString::Printf(TEXT("%s (%d)"), *Tag.ToString(), AbilityComponent->GetTagCount(Tag)));

In C++ it works just fine

1 Like