How to set player to target nearest enemy?

Surrealism 2 years ago updated 2 years ago 1

Hi, I'm creating a top down shooter for mobile and I'm figuring how to target the nearest enemy and set a variable to that target so my character will automatically fire at said enemy. 

I've heard of using Compare function to do it, but I'm not sure how to utilize it in bolt, or is there another easier way to do it? Thank you!

Bolt Version:
Unity Version:
Scripting Backend:
.NET Version (API Compatibility Level):

Solved, by using lists and foreach loops