AActor::ActorHasTag
#include "GameFramework/Actor.h"
Access: public
Specifiers: UFUNCTIONBlueprintCallableENGINE_API
Description
Returns true if this actor's `Tags` array contains the specified name. A lightweight way to categorise actors without subclassing.
Caveats & Gotchas
- • Actor tags are stored in a `TArray<FName>` and searched linearly. For actors with many tags or high-frequency calls (e.g., in Tick), consider caching the result or using a boolean property instead.
- • Actor tags and **component** tags are separate arrays. `ActorHasTag` only checks the actor's own `Tags` array — not the tags on any of its components.
Signature
ENGINE_API bool ActorHasTag(FName Tag) const; Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| Tag | FName | The tag name to search for in this actor's Tags array. | — |
Return Type
bool Examples
React when the overlapping actor has the Player tag
Blueprint
Filter overlapping actors by tag C++
void AMyTrigger::OnOverlapBegin(AActor* OtherActor)
{
if (OtherActor && OtherActor->ActorHasTag(FName("Player")))
{
ActivateTrigger();
}
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?