How do I Get The Sprite Type/Name from a Family Trigger

Get help using Construct 2

Post » Tue Feb 03, 2015 10:50 am

I have a condition

On Touch [Family]

I want to identify the type/name of the sprite was from that touch event, so I can do something if it was a specific type.

If the Family Instance Type that was touched was BOMB then do ABC
If the Family Instance Type that was touched was PRIZE then do XYZ
B
28
S
8
G
2
Posts: 58
Reputation: 2,586

Post » Tue Feb 03, 2015 10:52 am

Give the family a variable, call it "type". Give instances different values such as "bomb" "prize".

Event: On Touch
subevent: Variable type = bomb
subevent: Variable type = prize
B
146
S
73
G
20
Posts: 1,785
Reputation: 22,395

Post » Tue Feb 03, 2015 11:46 am

So if I have a "type" instance variable set for a family, it will inherit the value from the active instance? I tried this and I cant add 'type' to the Family because it already exists in the children...
B
28
S
8
G
2
Posts: 58
Reputation: 2,586

Post » Tue Feb 03, 2015 12:33 pm

Ya, you need to remove it from the babies, because the family needs to give it to them. The babies are blocking you from adding it to the family, because they have the same name.
B
146
S
73
G
20
Posts: 1,785
Reputation: 22,395


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 5 guests