control bullet spawn rate

scitunesscitunes Member, Sous Chef Posts: 4,047
edited November -1 in Working with GS (Mac)
how do I slow down the rate that a shooter can spawn a bullet?

I have tried a timer - every 0.5 seconds spawn bullet. When I do this it makes it so you have to hold the shoot key down for at least 0.5 seconds before it starts fighting. So then I put a spawn behavior before the timer. this makes it so it fires immediately, and then if you are holding it down the timer slows the rate down.

THE PROBLEM: because of that spawn behavior before the timer I can just tap the shoot key as rapidly as I want and it is not being slowed down by the timer.

Do I need to create some sort of boolean attribute (allowfire) and put it in a timer and make it so only a bullet will get spawned when allowfire = true? Will this work?

Comments

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    yep, that worked (as long as the timer was set to run to completion)
Sign In or Register to comment.