playMaker

Author Topic: Find from 10 objects which has the lowest position?  (Read 2426 times)

4ppleseed

  • Full Member
  • ***
  • Posts: 226
Find from 10 objects which has the lowest position?
« 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)

Zeldag

  • Full Member
  • ***
  • Posts: 198
Re: Find from 10 objects which has the lowest position?
« Reply #1 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.

4ppleseed

  • Full Member
  • ***
  • Posts: 226
Re: Find from 10 objects which has the lowest position?
« Reply #2 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.

Zeldag

  • Full Member
  • ***
  • Posts: 198
Re: Find from 10 objects which has the lowest position?
« Reply #3 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.
« Last Edit: June 28, 2016, 05:10:04 PM by Zeldag »

4ppleseed

  • Full Member
  • ***
  • Posts: 226
Re: Find from 10 objects which has the lowest position?
« Reply #4 on: July 01, 2016, 06:18:47 AM »
Yep, it worked well for me. I was totally overthinking it  8)

Thanks again.