How do I... pick nearest with y only

Get help using Construct 2

Post » Sun Sep 08, 2013 5:52 am

the pick nearest condition works for one point but i want just y position. how do i just do y?
B
60
S
19
G
3
Posts: 451
Reputation: 6,364

Post » Sun Sep 08, 2013 5:59 am

which: nearest
X: 0-740 (how do i do a range here?)
Y: 740
B
60
S
19
G
3
Posts: 451
Reputation: 6,364

Post » Sun Sep 08, 2013 9:49 am

You can iterate the object with the "for each" and then use the distance() function to find out which one is closest on the Y axis.

Edit:

Scratch that... distance() is also x,y....

So... iterate over the objects and just compare the Y values.cvp2013-09-08 10:32:13
B
20
S
6
G
4
Posts: 347
Reputation: 4,451

Post » Sun Sep 08, 2013 11:37 am

@Keepee solved this very elegantly here
B
28
S
12
G
4
Posts: 193
Reputation: 4,581

Post » Tue Sep 10, 2013 6:47 am

i dont get it. could you elaborate for me? i looked at the code and dont see the simularities of what im goimg for,
B
60
S
19
G
3
Posts: 451
Reputation: 6,364


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 10 guests