Regression: MakeLiteral GameplayTagContainer fails to match GameplayTag queries involving parent tags in 4.17.2 vs. 4.16.3

(originally posted in the “Questions/Blueprint Scripting” section - sorry about that)

Identical “Has Tag” queries on a GameplayTagContainer in 4.16.3 and 4.17.2 return different values.

For instance, adding the Tag Foo.Bar and then querying HasTag(“Foo”) returns true in 4.16.3 (correctly) and false in 4.17.2.

Specifically, it seems Parent tags are being improperly generated or searched on some GameplayTagContainers starting after 4.16.3.

I have minimal repro projects for these versions.

Repro case:

Project setup:

  • Make a new First Person Shooter project, no content.

  • Make a new DataTable based on the GameplayTag structure.

  • Add the tags to the table:

  • Character.

  • Character.PC

  • Add the table to the tags list in Project Settings->GameplayTags

  • Make a new blueprint derived from Actor called TestTag.

  • In TestTag, in event graph:

  • Key Step: Make a literal GameplayTagContainer, with tag Character., Connect it to a call to HasTag with a GameplayTag of Character, with “Exact Match” set to false. PrintString the value. It should return true, but will unexpectedly return false.

  • Next in the event graph, to confirm the error:

  • Make a blueprint variable of type GameplayTagContainer called myGTC

  • On begin play, do myGTC->AddGameplayTag(Character.). myGTC should now have Character. as a child tag and Character as a parent tag.

  • Print the result of myGTC->HasTag(Character) with “Exact Match” set to false. It will return (as expected) true.

In 4.16.3, a similar project had both cases return the expected value of true.

This is really fundamental to tags! So much so that I’m surprised to not see anything on this - I haven’t been able to find a similar bug report elsewhere.

In my main project, it looks to be even stranger - for instance, when I used the Tag AssetInterface calls, I got spurious results that seemed to sometimes be true or false in between loads without a Make Literal involved. No minimal repro case on that, but FYI to whomever fixes this that there were some other apparent instabilities in results. I’d suspect that the call on gameplay tag containers that populates the parent tags isn’t happening properly on MakeLiteral and/or some other cases.

If a repro project is needed, let me know- -jg

Hello ,

Thank you for reporting this issue and for providing detailed reproduction steps. I’ve reproduced the issue and while searching for similar bug reports before entering my own, I came across this one that has already been entered: UE-51299. It is marked as “To Do” at the moment so it has not been fixed but it is on the Dev’s radars. I would suggest following that page for updates to the bug.

Have a nice day!

Looks like the same bug indeed - will follow and thanks so much!

i am having the same problem with “has tag?” and “has any tag” functions. Neither is detecting parent tags, does not matter if i check the bool “exact match” or not.