Still struggling with on screen controls

cbowers428cbowers428 Member Posts: 176
edited November -1 in Working with GS (Mac)
I posted a couple days ago about issues with my on screen controls. I have a character, left button, right button, and "no touch zone" actor. I also have a game text attribute called "controls". When left touch is pressed AND the text attribute reads "none", the text attribute is changed to "left" and the character goes left. When left touch is released, the text attribute is changed to "none" and the character stops moving. The same set up is for the right button (except text is changed to "right" instead of "left" of course). In my no touch zone actor (which surrounds the left and right buttons), I have rules that say when touch is inside, change text attribute to "none".

This is a problem because when touch is pressed in the left or right buttons and text attribute is "none", the character goes left. So basically the no touch zone doesn't change anything and my character doesn't stop moving. Does anybody have a solution to this issue?

Comments

  • simo103simo103 Member, PRO Posts: 1,331
    can you post a screen shot or video of this .. I need to get my head around where your no touch zone actor is?

    My first thought is for you to create another attribute called say NoZone and have the no zone touch trigger an attribute change and then on the left and right buttons add the condition to the rule say when attribute NoZone=0 and when touch is pressed and test attribute reads none. that way your NoZone attribute is overiding and controlling.

    However I fear you have overlapping touch zones which might be an issue.
  • AjBlueAjBlue Member Posts: 215
    your doing it wrong, on buttons when mouse is down, change boolean attribute to true, otherwise boolean attribute = false. in actor when boolean attribute = true move actor to desired direction. then in no touch zone, when boolean attribute is true display text, and if both are pressed at the same time, you can put a extra rule in each button saying for example left boolean = true, and right boolean=false. display text left. so if both are pressed it still displays as none.

    i think thats what you are trying to do.
  • cbowers428cbowers428 Member Posts: 176
    I know what the issue is. It's that when I enter the no touch zone the text attribute goes to "none". The problem is that when the text is "none" the left and right still work because their rule states that when text is "none" and touch is pressed, change text to "right"/"left", respectively. I just don't know how to stop this from happening.
  • simo103simo103 Member, PRO Posts: 1,331
    that's why I suggest an additional attribute .. you are using the 'none' check on left right and no touch so it really isn't having any effect.
  • AjBlueAjBlue Member Posts: 215
    why are you running the left and right buttons off of the same text attribute? i'm sure if we could actually understand what you are trying to create there is a much simpler solution
Sign In or Register to comment.