Shooting timer

LBGLBG Member Posts: 277
edited November -1 in Working with GS (Mac)
Hi all,

I am trying to set a timer for shooting weapons. What I want to do is restrict the player to shooting say only every 1 second whether they continuously tap the shoot button or just hold it down.

If they hold the button down it is simple enough. I just have:
when actor recieves touch is pressed: every 1 second spawn bullet.

The problem is that the first bullet only spawns after one second. I therefore tried adding a simple spawn bullet when shoot is pressed rule but ofcourse this means you can tap the button over and over to achieve a faster firing cycle.

I am now trying to set the cycle time by having an attribute GunCycle and trying to use this to trigger the spawn Bullet on touch then changing it to false, then back to true after 1 second. Is this the right way of doing this?

Im sure someone out there has done this. I've been trying for a while now and it's really frustrating!!

Cheers

LBG

P.S I hope that was clear ;)

Comments

  • LBGLBG Member Posts: 277
    I think I have fixed it. I took out the timer for shooting every 1 second and created my own on off timer that changes an integer from 0 to 1 evry second after you touch the shoot button. This creates the desired cycle effect.

    If you guys have any other suggestions or better ideas I'd love to know them.

    Cheers

    LBG
Sign In or Register to comment.