pairing and unpairing two objects at runtime

Get help using Construct 2

Post » Thu Feb 06, 2014 1:59 pm

I want to pair two different objects at runtime so that picking works like it would if they were in the same container. I don't want to use a container because I don't ALWAYS need that object, and can't delete it without deleting everything else in the container.
B
6
S
3
G
2
Posts: 104
Reputation: 1,960

Post » Thu Feb 06, 2014 2:02 pm

I'm not sure to understand but...
Have you try Pin behaviour?
https://www.scirra.com/manual/99/pin
B
8
S
2
Posts: 35
Reputation: 838

Post » Thu Feb 06, 2014 2:12 pm

You can put the two objects in a Pair family and add an instance variable to this family, like "pairUID", in wich you store the paired object UID: when you pair object A to object B, set A.pairUID to B.UID and B.pairUID to A.UID.
Then, when you need to pick the two objects, just do use two conditions in a single event:

- A condition that pick object A
- B.pairUID = A.UID
B
12
S
5
G
2
Posts: 132
Reputation: 2,637


Return to How do I....?

Who is online

Users browsing this forum: gameba and 6 guests