Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: 4ppleseed on June 28, 2016, 12:52:16 PM

Title: Find from 10 objects which has the lowest position?
Post by: 4ppleseed on June 28, 2016, 12:52:16 PM
Hi all,
I have 10 game objects moving around the screen and every second I would like to check all ten and find out which one currently has the lowest Y position.

I've added the 10 objects to an Array (1.8) and know how to check an individual objects position but can't work out how to return for example: Game Object 4 is currently the lowest of the 10.

Any ideas?
Thanks  8)
Title: Re: Find from 10 objects which has the lowest position?
Post by: Zeldag on June 28, 2016, 01:14:14 PM
Hi,

What about the 'Find closest' action, it finds the closest object to another. So just make an invisible object and position it at the lowest point that the objects can get to.

Good luck, hope this helps.
Title: Re: Find from 10 objects which has the lowest position?
Post by: 4ppleseed on June 28, 2016, 02:07:48 PM
Hi,

What about the 'Find closest' action, it finds the closest object to another. So just make an invisible object and position it at the lowest point that the objects can get to.

Good luck, hope this helps.

Hmmm.... that's not a bad idea. I might have been side tracked with this whole array thing. Thanks for the suggestion, I'll try it and report back.
Title: Re: Find from 10 objects which has the lowest position?
Post by: Zeldag on June 28, 2016, 05:07:50 PM
Lol I did the exact same thing, soon as I read 10 items I thought array maker, then after thinking about it for a bit, this hit me (I guess it is just the awesomeness of array maker clouds my simple noob mind sometimes :D ).

Hope it works as you need it to.
Title: Re: Find from 10 objects which has the lowest position?
Post by: 4ppleseed on July 01, 2016, 06:18:47 AM
Yep, it worked well for me. I was totally overthinking it  8)

Thanks again.