Find enemy and make it the target of turrent

Should I be caching the enemies on the level into an array or list of some kind as they spawn? Do I find them by tags or their class? I have had a bit of trouble finding anything on this topic, any help would be appreciated.

The easiest way to look for enemies/targets is to get all actors of specified class from a world. In BP you do it by calling GetAllActorsOfClass, in C++ you do that in a for loop like this:

for (TActorIterator<APawn> It(GetWorld()); It; ++It)
{
    APawn* Pawn = *It;
    // do whatever you want with it here
    // ...
}

Of course you need to run it somewhere GetWorld makes sense. Use Pawn or AIController class, depending on what you actually need.

One thing to note is that this will get expensive the more actors you have on your maps, so I suggest caching your results and/or not running this too often.

Cheers,

–mieszko