Pick nearest only on X coordinates

Get help using Construct 2

Post » Thu Nov 26, 2015 10:10 am

Hello there,

I am using pick nearest for detecting surrounded objects, but I would need to detect/pick them only on X coordinates, inline on the platform. Does anyone have an idea how to disable picking by Y?

Thank you guys!
B
6
S
1
Posts: 16
Reputation: 357

Post » Thu Nov 26, 2015 10:22 am

After picking, you can check if the X coord is a certain value, the x of the platform.
Banned User
B
6
S
3
Posts: 105
Reputation: 1,170

Post » Thu Nov 26, 2015 10:22 am

Something like this?

Image

Example R218
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Nov 26, 2015 10:43 am

there is also event..System pick by comparison
Image

now you can add ad another condision...pick nearest..
Image
B
62
S
23
G
7
Posts: 1,470
Reputation: 10,731

Post » Thu Nov 26, 2015 11:06 am

korbaach wrote:there is also event..System pick by comparison
Image

now you can add ad another condision...pick nearest..


That would only work if the other coordinate is exactly the same, right?
Maybe a sprite is between y-values would solve that..
Without knowing what the exact aim of this check is though, I chose not to limit the comparison in any way..

I would recommend adding other conditions to my event, so the amount of sprite2 that are being compared are less and maybe the moment when it is done is not every tick..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Nov 26, 2015 11:17 am

LittleStain wrote:That would only work if the other coordinate is exactly the same, right?

Yes.. @LittleStain ..you're right..

but topic is named "Pick nearest only on X coordinates" so....
Image
B
62
S
23
G
7
Posts: 1,470
Reputation: 10,731

Post » Thu Nov 26, 2015 11:19 am

Thank you for your advices, I'll go through it and let you know!
B
6
S
1
Posts: 16
Reputation: 357


Return to How do I....?

Who is online

Users browsing this forum: ankas and 9 guests