sliding finger off of game button...

Cee3pee0Cee3pee0 Member, PRO Posts: 194
edited November -1 in Working with GS (Mac)
In my game, when i slide my finger off a button it keeps controlling the action even when i'm not touching the button or the screen anymore, i have to press the button again to get it to "unlock". I have 2 rules for the button that when it is released and when touch is outside it should stop, and it does if you are still on the button (like it is suppose to). But if my finger accidentally slips off the button the action stays locked. anyone know a remedy for this? kind of a game-breaker..

Comments

  • IntelligentDesignerIntelligentDesigner Member Posts: 517
    What does your rule say? Are you using actor receives touch pressed?
  • Cee3pee0Cee3pee0 Member, PRO Posts: 194
    yeah receives touch pressed, changes attribute to 1,
    otherwise, when touch is released, or is outside, changes attribute to 0
  • IntelligentDesignerIntelligentDesigner Member Posts: 517
    Are you using compound conditions? All/Any?

    Set the movement with the button, and have the actor move if the attribute is set, and reset the attribute so it is not active until the button is pressed again.
  • reddotincreddotinc Member Posts: 653
    This is the same issue that we have, the button is pressed and you move your touch off the button, yet the button stays "active" until you touch it again. The touch needs to be constrained to the button region, but how?
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    You could try if touch is pressed change attribute to 1, otherwise, change attribute to 0. Forget the 'otherwise if touch is released'. You could also put a display text actor on your scene and have it display the text for that attribute, you would therefore know if it is switching correctly or not, that should tell you if its a problem with the button changing the attribute or whether its the rules within the actor
  • reddotincreddotinc Member Posts: 653
    ^^ good idea! I'll try that. thanks.
  • reddotincreddotinc Member Posts: 653
    ^^ good idea! I'll try that. thanks.
  • beefy_clyrobeefy_clyro Member Posts: 5,394
  • QuinnZoneStudiosQuinnZoneStudios Member Posts: 452
    I had the same problem, using a touch rule and a release rule.
    I sort of fixed it by putting a timer on it, saying "after 0.7 seconds, change to "false". That way, if or when it gets stuck in the on position, it hardly notices because the timer corrects it.

    Cunning but it worked!
  • JGary321JGary321 Member Posts: 1,246
    For this all you need is:
    Conditions is `ALL` not any

    When touch is `PRESSED`
    When touch is `INSIDE`

    blah, blah

    Otherwise

    blah, blah

    I tried it & it worked perfectly.
  • QuinnZoneStudiosQuinnZoneStudios Member Posts: 452
    Ohhh of course! Fantastic - I'll try it right away!

    Thanks JGary321
  • Cee3pee0Cee3pee0 Member, PRO Posts: 194
    this worked great, thank you!
  • reddotincreddotinc Member Posts: 653
    All i needed was "If touch = pressed" then set attribute to 1, otherwise set attribute to 0.

    Thank you beefy!
Sign In or Register to comment.