[Blueprint to C++] How to loop in GetComponentsByTag in C++?

How can i replicate this(img)?

I´ve tried many things, including what you can see in that image.

Thanks everyone who can help!

For each loop is actully fresh feature in C++ added in C++11 standard (which latest compilers support and UE4 actully requires), you actully close, you just need to change 2 things :slight_smile: you do this way:

for(UActorComponent* actComp : player->GetComponentsByTag(subBox, TEXT("Damage"))) {
      actComp->DoSomeStuff();
}

Also this worth mention this works on any standard C++ iterator (impements end(), begin() and operators * and ++), TArray is a custom UE4 type and it implments that, thats why it works with it

Thank you XD