Button Trigger Problem

Fal01Fal01 Member Posts: 460
Hi all,

I have a button in my game that when pressed triggers certain attributes-ie when touch count =1 -60 coins

The problem I have is that if you press it really quickly it doesn't have time to trigger the attributes and you end up with varying degrees of wrong results.

I've tried a timer on the touch count but it doesn't help.

Any help would be greatly appreciated.

It’s not a bug – it’s an undocumented feature

Best Answer

  • contrasthallcontrasthall Posts: 131
    Accepted Answer
    couldn't imagine the problem then but if a quick double touch is giving you a problem you could make a true false "lets call it wait" so when touched and wait is false then counter = counter + 1 wait is true.

    outside of that rule do a if wait is true then after .5 seconds timer wait is false...

Answers

  • contrasthallcontrasthall Member Posts: 131
    can you give us a better listing of the touch and its rules or a screenshot of the rules you set up, after that this should be a quick fix, thanks.
  • Fal01Fal01 Member Posts: 460
    Hi @contrasthall,

    Yeah it's a quiz game and the rules are basically set up like this-

    The button in question reveals hints from a table, there are 3 hints per level.

    There is an index attribute that counts the times you press the button.

    So if button count = 1-(reaveal hint 1), take away 60 coins, attribute (show hint 1)=true

    if button count=2-(reveal hint 2), take away 60 coins, attribute(show hint 2)=true

    And the same for the third hint.

    It works fine if you press the button with a gap between the presses but if you press it fast repeatedly it gets messed up.

    Hope this makes sense!

    It’s not a bug – it’s an undocumented feature

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    Did you try using "when button is released" instead of "when button is pressed"? Just at thought, sometimes mixing that up has slightly different results....
  • contrasthallcontrasthall Member Posts: 131
    try just making it a simple counter with a rule like : if touch is pressed - then counter = counter +1.........then add the other stuff completely outside that rule so a rule that says if attribute counter > 0
    then if counter = 1 do this
    if counter = 2 do this

    side note you could should probably also set inside the button to do nothing to the counter if its at your top number which sounds like 3 so the actual rule in the touch is if counter < 4 then counter = counter +1
  • Fal01Fal01 Member Posts: 460
    @contrasthall, Yeah I should have said that. The rule that counts the touches is separate from the rest of the rules that each count triggers.

    @jamie_c, I have tried that but for some reason it took off double the amount of coins and I couldn't figure out why.

    It’s not a bug – it’s an undocumented feature

  • contrasthallcontrasthall Member Posts: 131
    in your first post you wrote about touch count if you were refering to gamesalads multi touch attributes then thats the problem because thats not what you need in this situation. you should be using a actor recieves - touch - pressed rule and a simple counter inside or a true or false inside so that you can set a false for the otherwise of the button rule
  • Fal01Fal01 Member Posts: 460
    I'm not using multi touch, it is as you described when actor is touched with a counter.

    It’s not a bug – it’s an undocumented feature

  • Fal01Fal01 Member Posts: 460
    Thank's for your help @contrasthall.

    It’s not a bug – it’s an undocumented feature

Sign In or Register to comment.