How do I differentiate between two of the same object

Just started using Construct 2? Post your questions here

Post » Wed Apr 08, 2015 6:07 am

I have 3 of the same object (Mushroomcrab) in a layout and I need another object (Bosscrab) to go to the closest one to him. The one enemy has a Line of Sight behavior and is supposed to move toward one of the mushroomcrabs depending on an instance variable however it will always attempt to move toward the first mushroom crab that was placed on the layout rather than the closest one.

Is there a way to have the Bosscrab move towards the closest Mushroomcrab rather than the first one placed on the layout? Will I need to use the UID for objects to achieve this?

Image
B
9
S
1
G
2
Posts: 84
Reputation: 1,143

Post » Wed Apr 08, 2015 7:26 am

You could try the condition:
Mushroomcrab pick nearest to bosscrab.x, bosscrab.y
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 Apr 09, 2015 12:57 am

I didn't know that condition existed, thank you for guiding me to it.
B
9
S
1
G
2
Posts: 84
Reputation: 1,143


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 4 guests