How do I perform an action only on an objct of a family?

Just started using Construct 2? Post your questions here

Post » Sat Jan 16, 2016 1:57 pm

for example: on mouse click I change the position of the object I clicked on and not on the other object of the family.
B
12
S
5
Posts: 55
Reputation: 1,060

Post » Sat Jan 16, 2016 3:36 pm

Image

There you go.
B
14
S
1
Posts: 65
Reputation: 732

Post » Sat Jan 16, 2016 4:12 pm

EdwardjT92's example works even if your condition is "family clicked" and action is "set family position to 0,0" it will still only move the clicked object since the click "picks" that member only. If your trying to do something less selective you will need to make sure of which family member you are "picking" in the event conditions. You can do this by using distance to something (ie. closest instance, etc), UID, or using instance variables inside family members.. IsChoosen=0... IsChoosen=1...
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
54
S
15
G
8
Posts: 610
Reputation: 8,771

Post » Sat Jan 16, 2016 6:53 pm

what if I want the action to be repeatable? click on an a member of a family and affect only that member, then repeat the action on another member and affect only this other member and so on?
B
12
S
5
Posts: 55
Reputation: 1,060

Post » Sat Jan 16, 2016 10:39 pm

It already is repeatable, although edward didn't use a family in his example, but I guess you noticed that.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 2 guests