How do i add/remove tags from a component in code?

i would like to know how to add or remove tags in code (mainly add). I know how to check for a components tag but i need to know how to add one in c++.

1 Like

Hi ,

Every ActorComponent has field ComponentsTags. It is TArray, so you can add/remove tags like this

pActorComponent->ComponentTags.Add(FName("NewTag"));
pActorComponent->ComponentTags.Remove(FName("OldTag"));

Hope it helps!

2 Likes

is there a way to do it with blueprints?


The object in the screenshot is a Static Mesh component, you can add/get tags in blueprints this way.