playMaker

Author Topic: Find Closest. No? Then find NEXT Closest. Repeat. How?  (Read 1176 times)

westingtyler

  • Sr. Member
  • ****
  • Posts: 277
    • My Video Game Projects Web Site
Find Closest. No? Then find NEXT Closest. Repeat. How?
« on: February 09, 2017, 07:45:08 PM »
How do we do this? There's not command for "next closest." How do we tell it to find the NEXT closest, after testing the closest object, and to continue doing this until it finds a suitable game object?

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Find Closest. No? Then find NEXT Closest. Repeat. How?
« Reply #1 on: February 10, 2017, 12:23:19 AM »
Add them to an array, run get distance on all of them, sort array, get item with index you want.

Here's a video that can help, courtesy of djaydino:
http://hutonggames.com/playmakerforum/index.php?topic=10906.0
Available for Playmaker work