How exactly does touch work in rules?

BacktothisBacktothis Member, PRO Posts: 75

So I've been using something that works, but I don't quite get why it works.

So let's say we have two actors of type TypeTouched. What we want is that if one of these is touched, then nothing happens, but if somewhere else is touched, then we change scene. This can be done by changing scene if an attribute named ChangeScene is true. So, we have the following behavior in each of the actors:

Rule: If touch is pressed
--> Change Attribute: TypeTouched="true"
Otherwise:
--> Change Attribute: TypeTouched="false"

And then we have the actor that actually checks ChangeScene in a layer above those two actors.

Here's what I don't understand. So let's say the layer is organized as follows, from bottom to top:
ChangeSceneDetector
TypeTouched #2
TypeTouched #1

So if TypeTouched #1 is pressed, then it will change TypeTouched to "true". But, then shouldn't it be changed to "false" by TypeTouched #2? And then the scene would change.

Furthermore, the next time these rules are evaluated, if there is no touch at all, wouldn't they both be set to false, and then the scene would change?

Obviously this isn't what happens, but I don't quite understand why.

Sign In or Register to comment.