Touching Actors

osucowboy18osucowboy18 Member Posts: 1,307
edited November -1 in Tech Support
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

Comments

  • DrGlickertDrGlickert Member Posts: 1,135
    What's your intention for the game? What are you trying to accomplish? Do you want the player to be able to drag actor A someplace, exposing actor B? Then be able to drag actor B around?

    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.
  • MotherHooseMotherHoose Member Posts: 2,456
    had the same problem with 25 drag-able actors...
    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
  • osucowboy18osucowboy18 Member Posts: 1,307
    Hey guys, just got this working, thanks for your help :)

    - Alex
Sign In or Register to comment.