Nearest enemy to my player character

You should not use GetAllActorsOfClass during gameplay as it is a very slow function. Keep an array updated with the current NPCs and use that instead. GetSquaredDistanceTo is also faster than GetDistanceTo.