Hi!
Is there a way to store Gameplay tags names instead of hard coding it?
Thank you!
Actual GameplayTags could be a good use case for this, however if you want to use them the same way in pure blueprints you’ll stumble upon some issues
GameplayTags (not actor tags) are basically global names with some added functionality, such as a hierarchy
There is an interface called GameplayTagAssetInterface, which can be implemented to provide some gameplay tag related functionality to a class, such as GetOwnedGameplayTags, HasMatchingGameplayTag, HasAllMatchingGameplayTags, HasAnyMatchingGameplayTags, which would work well for you. However this interface cannot be implemented in blueprint, and has to be implemented in C++
You could recreate the interface in blueprint, and create the functions and implement them yourself using a GameplayTagContainer in your actor or one of its components, and then call the new interface functions to check the tags. It’s a bit of a hassle but it can be done, and should give you some more flexibility, since there are plenty of other blueprint implemented gameplay tags functions, such as running Gameplay Tag Queries, which allows you to define a specific tag ruleset that you want to match.
Gameplay Tags also have some very nice editor functionality, including reference viewing, so you can see all assets that are referencing a specific tag, which is really useful. They can also be renamed and support redirectors, among other cool things
So I would suggest using Gameplay Tags instead of plain strings for your case, even though it requires a bit more setup, and is done better using some little C++
Using Gameplay Tags in Unreal Engine | Unreal Engine 5.7 Documentation | Epic Developer Community