Turn off rule for 4 seconds?

GoldensnypaGoldensnypa Member Posts: 32
edited November -1 in Working with GS (Mac)
So I have a box on the screen with a fairly basic rule which is, When mouse button is down, for 2 seconds, increase size with growth rate at 1, after 2 seconds, for 2 seconds increase size with a growth rate of -1. Luckily this rule works fine. But the problem is, when I click the mouse button and the rule follows, I want the rule turned off for 4 seconds until the size changes finish. Because when I continuously hit the mouse button, the box gets smaller even though I set the timer on 'run to completion'. Does anyone have an idea on how to turn off a rule for a number of seconds? Thank you.

Samer

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    use a attribute. Make a attribute Call it sizeIncreaseOn or wahtvere you want. Have a rule when mouse button is down, change attribute sizeIncreaseOn to 1. Then put a timer in that rule after 6 seconds RUN TO COMPLETION CHECKED, change attribute sizeIncreaseOn to 0

    Then all the other rules you have for when mouse is down change size, witht the timers to change back; put that in a rule when sizeIncreaseOn=0 the way when its happening it cant be triggered again till after its finished
  • GoldensnypaGoldensnypa Member Posts: 32
    Ok, the replies are greatly appreciated! I'm going to try the suggestions now.
  • GoldensnypaGoldensnypa Member Posts: 32
    Ok, I have followed tshirtbooth's suggestion here and thankfully it worked, I had to put the change attribute self.active is true Inside the timer. But the problem is, now that continuously clicking wont work, the box how ever is still growing smaller in a very small growth rate when the mouse button is clicked continuously, I don't know what is causing this, do you think its a bug or is the preview not as accurate as the actual published game? Thank you for your time.
Sign In or Register to comment.