Pick closest object

For questions about using Classic.

Post » Thu May 19, 2011 3:24 pm

Hello, I have a question about picking the closest object.

I have the following problem:


The small bar on the left is the user. The big blocks are the same object (copies).

When the user overlaps an object (as seen in row 2) and presses the space key, the object changes colour.

When the user overlaps both objects (as seen in row 3) and presses the space key, the closest object (to the user) should change colour. But as you can see in row 3, that doesn't happen in my case.

I've tried to use the pick closest condition, but that didn't work. Does anyone have an idea on how to solve this?

Edit: I've also tried the 'pick by comparison and then compared object.x and object.x (but I think that it compares the same object's value against the same object's value..)

Thank you,
Maarten
B
2
S
2
G
1
Posts: 109
Reputation: 1,068

Post » Thu May 19, 2011 4:01 pm

[quote="Muurtegel":1v8dy8it]I've tried to use the pick closest condition, but that didn't work. Does anyone have an idea on how to solve this?[/quote:1v8dy8it]

Not sure why that wouldn't work for you. It works perfectly for me:
http://dl.dropbox.com/u/529356/Construc ... losest.cap

Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Thu May 19, 2011 5:24 pm

After reading that it worked for you, I tried it again and found my problem. I called a function to change the colour and tried to pick the right object before I sent the function (with 'remember picked object'). That didn't work.

It did work when I picked the object after the function was sent. (So pick the object in the function itself).

Thanks for helping me!
B
2
S
2
G
1
Posts: 109
Reputation: 1,068


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests