Pick object with lowest value

Get help using Construct 2

Post » Sun May 05, 2013 4:51 am

So I have multiple copies of an object overlapping and I want to pick the one with the lowest instance variable. Any ideas?
B
6
S
1
Posts: 19
Reputation: 544

Post » Sun May 05, 2013 5:25 am

Maybe if you make an event like this:

For each 'object' (ordered): order by 'variable'
> Object: move to bottom

Then you can use the "pick top" action because the one with the highest 'variable' was the last one sent to bottom, which means the top one is the lowest 'variable'
B
83
S
21
G
15
Posts: 1,039
Reputation: 15,134

Post » Sun May 05, 2013 5:41 am

@7soul

after ordering by the variable ascending.. you can just put in a 'stop loop' action and it won't repeat for the others.
B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Sun May 05, 2013 7:45 am

Problem solved.

@7soul
worked perfectly, thanks!
B
6
S
1
Posts: 19
Reputation: 544


Return to How do I....?

Who is online

Users browsing this forum: getplay and 26 guests