problem: Smallest value

Get help using Construct 2

Post » Mon Oct 22, 2012 11:07 am

I have several copies of the same object, which I divided with a private variable with a number. I need a character to interact only with the one that is closer to the player. For this I created a private variable that calculates the distance between the player and the object. But as it is now to make the object, for example, when I press the delete is the closest object to it?
B
12
S
1
Posts: 36
Reputation: 1,731

Post » Mon Oct 22, 2012 3:56 pm

You can use the "Pick nearest" condition to save the closest object's UID in a variable, then check if the UID of the object you click is the same as the one stored in the variable.

Example:
PickClosest.capx (r107)Nimtrix2012-10-22 15:57:50
B
27
S
8
G
8
Posts: 903
Reputation: 8,452


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 31 guests