Tower Defense Targeting Help

TreysForDaysTreysForDays Member Posts: 2
edited May 2014 in Working with GS (PC)

I cannot figure how to make my turret select the enemy that is closest to the finish while in its range. I currently have a table with each x and y coordinate and distance traveled is there any way to take all of these and select the max? Would greatly appreciate any help.

Comments

  • TreysForDaysTreysForDays Member Posts: 2

    Bump

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    You can use a combination of magnitude(), which calculates the distance between two points and max(), which calculates the largest value of two or more expressions.

Sign In or Register to comment.