Touching actors without triggering the ones below?
beefy_clyro
Member Posts: 5,394
Hi. I have a problem where i have an actor appear to indicate you have unlocked something, the problem im having is that you need to touch this actor to destroy it. Underneath that actor is other 'touchable' actors, i want the 'unlocked' actor to come to the front (which is does), you touch it to destroy it and you then move on. What is currently happening is that the unlock appears, you touch it but it is also triggering the stuff behind it. I guess i could control all this via attributes but is there an easier solution?
Thanks
Thanks
Comments
In the actors that you don't want to be triggered during the popup wrap their touch rules in a rule that says when game.PopUp is false.
Then in the rule that triggers the pop up window to appear use a change attribute behavior to change game.popup to true. then change it back to false just before destroying the popup.
However, if it isn't a situation with a popup which you can control, it is either not possible or very difficult to have two overlapping actors with click or tap rules.
Currently, you need to design your game so that situation does not happen.
The stacking order of object is called their Z-index. Right now, we don't have access to an actor's Z position - just their X and Y positions.
If we had access, we could compare the two Z positions of the two actors and do something about it.
It would also be great to have a boolean attribute in an actor that decided if the Actor was able to be 'clicked-through' or not.