How to determine actor tags

Hey guys,

I’m having some difficulties using the tags for an object. I’m making a few objects through C++ and trying to add tags, but I can’t seem to add tags where I need them. I can only seem to add tags in the components of an object, which I can’t seem to use.

Can anyone tell me how to set the tags in the circled areas of the image below, in C++?

Now, the reason I ask this is because I’m implementing a line trace that uses tags. The line trace only seems to succeed if I manually input the tags in the circled areas of the image.

Hey Mookiez,

If you want to add a Tag to the Actors Tags (not the ComponentTags for UActorComponents), you simply need a reference to your Actor and do the following:

MyActor->Tags.Add( FName( "New Tag Name Here") );

Perfect, thanks

omg , I was so stuck using LineTraceSingleByProfile and the HitResult.GetActor()
to later check if has the Tags with ActorHitted->ActorHasTag(FName(TEXT(“Interactable”)));

And after few hours trying everything I came to realize that there are 2 types of Tags

Thank you for question and answer

1 Like