I’m just now learning how to use Gameplay Tags due to a blog I found explaining what they were. I’ve started setting the system up for my game but I came across an issue with the Get All Actors Of Class Matching Tag Query node.
I want to use this node dynamically and create the query input it requires from a tag container variable. Does anyone know how to properly use this node and is there a reason it can’t be dynamic or am I just not seeing something?
Edit: Here is a better representation of what I was looking for.
Edit 2: Apparently this is an issue with the node itself since it requires an interface that doesn’t look like its exposed to blueprint. According to this video the node has issues with blueprint so does anyone know when this will be resolved?
This approach should work.
Add a variable called tag of type integer to your blueprint.
Initialise this with a unique value say 0.
Then use the get all actor by class node
Loop over each item with a foreachloop
Take the element pin an connect it to a get tag node. Make sure context sensitive is unchecked
Then use a conditional statement to compare your tag value to 0.
If it matches then you have the reference to the instance of this class.
A peep in the source code of UBlueprintGameplayTagLibrary make it clear how the GetAllActorsOfClassMatchingTagQuery is working.
in Unreal 5.4.4, BlueprintGameplayTagLibrary.cpp line 120, after getting all the actors of the specified class, the code validate the presence of the inteface.
IGameplayTagAssetInterface* GameplayTagAssetInterface = Cast<IGameplayTagAssetInterface>(Actor);
if (GameplayTagAssetInterface != nullptr)
{