You create two variables, one float SelectedLength one “NearestEnemy” = “actor from class” that you selected. you set SelectedLength a high value. Then on loop, each time new length is shorter than the saved one (on true) you set selectedLength and “NearestEnemy” with actual values" from length and array element.
Then from the completed output (not from the loop body as you did) you set your “simple move to actor” with your "nearest enemy variable as target.
I let you try by yourself to discover arrays but if you have issue, don’t hesitate to come back.
Edit : The controller has to be the enemy controller. you’ll can drag it from your reference. And if your enemy is spawned you’ll may have to add a spawn default controller too to have it working.
It would be something like this :
The spawn default controller is needed only if you didn’t set your enemies in level but spawned them.