How do I detect unit within certain radius of another unit?

Get help using Construct 2

Post » Tue Mar 10, 2015 10:31 pm

hello,
need help to set conditions to detect every unit within certain radius or distnce of another unit?
in proximity, like radar...

any tips?

tnx!
Last edited by irina on Wed Mar 11, 2015 1:21 pm, edited 1 time in total.
B
26
S
11
G
2
Posts: 669
Reputation: 5,038

Post » Tue Mar 10, 2015 10:41 pm

Image ImageImage
B
166
S
49
G
154
Posts: 8,104
Reputation: 100,229

Post » Tue Mar 10, 2015 10:51 pm

Spawn a circle sprite and pick everything that overlaps it.
B
47
S
16
G
9
Posts: 1,097
Reputation: 11,180

Post » Wed Mar 11, 2015 1:21 pm

@newt
thanks but i need some math. equation solution.

@spongehammer
thats plan B if noone has idea how to do it by some math equation....

anyone has some math sloution?
B
26
S
11
G
2
Posts: 669
Reputation: 5,038

Post » Wed Mar 11, 2015 1:57 pm

Well strictly speaking that is using an equation, its just that you dont see it.
B
47
S
16
G
9
Posts: 1,097
Reputation: 11,180

Post » Wed Mar 11, 2015 2:01 pm

You can use for each, and distance(), but its not very efficient.
Image ImageImage
B
166
S
49
G
154
Posts: 8,104
Reputation: 100,229

Post » Wed Mar 11, 2015 2:29 pm

Pick by comparison, distance() < range
B
62
S
26
G
24
Posts: 954
Reputation: 18,318


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests