Determine the Type of Child From a Family Click / Tap Condition

I spent days scouring the forums trying to figure out how to determine exactly what type of object triggered the condition.

In my case, I have a family with many sprites, and I want to know exactly what sprite from that family was the trigger, and take an action based on it.

1) Create The Family and Add the Children

2) Create an Instance Variable for the Family called "type" as a text with no initial value

3) For each of the family's members, create an event for On Created that will set "type" to a value unique to that child.

4) You can later test this variable and perform actions based on it.

  • 0 Comments

  • Order by
Want to leave a comment? Login or Register an account!