Ability CoolDown

markovmarkov Member Posts: 20
edited November -1 in Working with GS (Mac)
Hello!Lets say i want my Player to have a special ability (something like to become a rocket for 2 secs),i finally made it to make the thrust effect on my player and everything looks cool,when im hitting the space button(space=player becomes rocket and fly)my player can fly for 2 seconds.But what i want is that if i ll try to press space again i want this ability to be immune to my control for 5 seconds,and only after 5 seconds he can fly again.Is this possible?

Comments

  • calvin9403calvin9403 Member Posts: 3,186
    yes

    make an attribute able to fly? bool true

    when attribute able to fly is true and touch is press, do something and change attribute able to fly to false

    when attribute is false set timer after 5 secs change it to true

    Calvin
  • markovmarkov Member Posts: 20
    Thanks for the reply!I tottaly got the logic but apparently i cant get it to work this is what i did after i made the RocketReady attribute:Rule(when i press space)-->change attribute(self.RocketReady To False),Timer(For 0.6 secs Accelerate{rocket is flying for 0.6 secs}),NEW timer outside the previous one after 5 secs change attribute RocketReady to true.

    Still the same,nothing changes,space works every time :'( any thoughts?
  • calvin9403calvin9403 Member Posts: 3,186
    well maybe you should put the second rule in the other rule

    so when attribute is false put it in the timer and set for after 5 secs change to true
  • markovmarkov Member Posts: 20
    i dont have a 2nd rule :/ this is exactly what i have :p and hey..thanks for your time mate!

    http://imageshack.us/photo/my-images/5/43404609.png/
  • markovmarkov Member Posts: 20
    i renamed the RocketReady attribute to JetPackReady
  • calvin9403calvin9403 Member Posts: 3,186
    hey put the timer rule out side

    Calvin
  • RadiationYTCRadiationYTC Member Posts: 5

    I WAS MAKING A COOLDOWN IN MY PROJECT THIS IS WHAT I DID TO GET IT TO WORK

    You do this

    Rule:

    receives a key press space is down

    do:

    spawn actor astroid in front of actor

    change attribute set spawn cooldown to false

    timer after 3 seconds run to completion

    change attribute set spawn cooldown to true

  • RadiationYTCRadiationYTC Member Posts: 5
Sign In or Register to comment.