0

How to set player to target nearest enemy?

Surrealism 2 months ago updated 2 months 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:
2019.2.1f1
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):
+1

Solved, by using lists and foreach loops