Touching Actors
osucowboy18
Member Posts: 1,307
Hey everyone,
So in my latest game, I have two actors, Actor A and Actor B. Actor A is positioned on top of Actor B in a scene. When someone touches Actor A, I do not want them to also touch Actor B at the same time. I have tried putting Actor A and Actor B on different layers, but when the user touches Actor A, Actor B is also touched. Is there a way to ONLY touch Actor A, even though it is positioned on top of Actor B? Any ideas would be appreciated. Thanks.
- Alex
So in my latest game, I have two actors, Actor A and Actor B. Actor A is positioned on top of Actor B in a scene. When someone touches Actor A, I do not want them to also touch Actor B at the same time. I have tried putting Actor A and Actor B on different layers, but when the user touches Actor A, Actor B is also touched. Is there a way to ONLY touch Actor A, even though it is positioned on top of Actor B? Any ideas would be appreciated. Thanks.
- Alex
Comments
If that's your intention then I'd use a rule on Actor B that if it's overlaping with actor A to be true, when it's not overlapping with actor A set it to False.
Then make the rule in actor B have 3 parts; when touch is press, mouse is inside, and self.actorBattribute = false then 'do what you want it to do...'
If that's not it, let me know.
finally put gameAttribute Index type...
and on actors' attribute myIndex# (integer type)
behaviors
Rules when
-touch is pressed
--changeAttribute game.selectedIndex To: myIndex#
--Rule when
---Attribute game.selectedIndex = myIndex#
----constrainAttributes (to touch behaviors)
Otherwise: Rule for when touch is released change the selectedIndex to 0
MH
- Alex