Pick nearest "of these"

Get help using Construct 2

Post » Tue Sep 03, 2013 1:12 pm

Hi,

I wonder how to pick the nearest one of some Object Instances.

The aim is to pick the closest Object to a target, but the choice should not be done of all instances, rather only between Objects with specific UID's

Someone has an idea?

:)
B
15
S
3
G
5
Posts: 396
Reputation: 4,977

Post » Tue Sep 03, 2013 3:59 pm

you could try 'for each - ordered' by distance() ascending, with your other conditions to choose the specific instances. you'd break the loop the first time it runs to pick only the nearest instance.
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,679

Post » Wed Sep 04, 2013 9:49 am

This should do the job, many thanks :)
B
15
S
3
G
5
Posts: 396
Reputation: 4,977


Return to How do I....?

Who is online

Users browsing this forum: SputnikCZ and 2 guests