Hi, Im trying create a tracking system for my turrets in UE C++. Im made 3 functions for this, but turrets don’t see a tags by enemys and don’t tracking thems. I don’t understand what i do wrong
That function dont work, dont find the tags on the Actors, idk why
Hi, do you want to use tags or GameplayTags? Cause in your question header you say GameplayTags but GetAllActorsWithTag looks for tag, not GameplayTag and GameplayTags are constructed via FGameplayTag::RequestGameplayTag("something"), AFAIK TEXT("something") will not work.
If you want to use build in queries for gameplay tags the actor needs to implement the IGameplayTagAssetInterface. Therefore it makes sense to have the FGameplayTagContainer where you store the GameplayTags of that actor in your cpp class.
If you want to query for actors for specific GameplayTags you could use the GetAllActorsOfClassMatchingTagQuery function of the UBlueprintGameplayTagLibrary (will only work if your actors implement the IGameplayTagAssetInterface)
You could look at my second post here Blueprint - EQS and Gameplay Tags - I need help! - #3 by ViridianGU there I have posted a minimalistic example of the .h file of a character that implements the IGameplayTagAssetInterface (no need to do anything in the .cpp file). If you inherit from actor, the changes would be the same (so also inherit from IGameplayTagAssetInterface and then copy everything following “// Need to store the GameplayTags…” to the .h file)