GAS "Add Loose Gameplay Tags" adds multiple instances of the tag

Using GAS’s “Add Loose Gameplay Tags” node adds one “instance” of this tag per execution. So if we add this tag 10 times to the actor, we have to remove it 10 times as well to actually remove it.

How can I ensure only one of these instances exists at a time?

Here is the screen of the header for 5.3

Your options are:

  1. use Count param on deletion with value = infinity (99999 or any other number you’ll never reach)
  2. use SetLooseGameplayTagCount() with NewCount equal to 1 and 0 instead of add & removal

Generally i suggest to take a look at ASC header, as it usually have all the answers you’ll need. And if you need something deep - you always may delve into implementation

1 Like

Super helpful information!

Quick question though, is SetLooseGameplayTagCount setting the current count or the count cap?

Edit: Nvm, idk why I didn’t just look in the class itself. It does indeed set the “Current” count.

Thanks again

Just wanted to say thank you! I made an event that removed and added two opposite tags depending on a bool, with a print string telling me if the removal of the tag was successful as well as printing the owned gameplay tags at the end. And even though removal where “successful”, the printed tags at the end still contained the removed tag! So if anyone gets in the same pickle as me; if you print string “Get owned Gameplay Tags”, its Not going to say if you have multiple of the same tag

1 Like

yup, it can be tricky for exactly that reason. i don’t remember if there was a way to get the count of a gameplay tag in BP, but I think there may have been one in c++. I think its “GetGameplayTagCount.

So if you can’t access it from BP, you can also get it from a function library. Then in BP you can have a check before adding a gameplay tag to see if it’s already greater than 0.