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
29
S
11
G
2
Posts: 692
Reputation: 5,159

Post » Tue Mar 10, 2015 10:41 pm

Image ImageImage
B
171
S
50
G
180
Posts: 8,394
Reputation: 113,982

Post » Tue Mar 10, 2015 10:51 pm

Spawn a circle sprite and pick everything that overlaps it.
B
50
S
16
G
9
Posts: 1,098
Reputation: 11,237

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
29
S
11
G
2
Posts: 692
Reputation: 5,159

Post » Wed Mar 11, 2015 1:57 pm

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

Post » Wed Mar 11, 2015 2:01 pm

You can use for each, and distance(), but its not very efficient.
Image ImageImage
B
171
S
50
G
180
Posts: 8,394
Reputation: 113,982

Post » Wed Mar 11, 2015 2:29 pm

Pick by comparison, distance() < range
B
75
S
31
G
27
Posts: 1,000
Reputation: 20,735


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 17 guests