HOW TO SHOOT without haveing to hold down

azemurderazemurder Member Posts: 2
edited November -1 in Working with GS (Mac)
i want to shoot missiles with a 5 second interval... but i can't figure out how to set it without it only shootting every 5 seconds by holding down the button. Is there a way to fire a missile every 5 seconds without having to hold the button down that long?

Comments

  • Ruslan21Ruslan21 Member Posts: 228
    in you actor that you want to shoot every 5 seconds, put behavior "spawn actor"

    Spawn actor" missile " every 5 seconds

    Thats it
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    Rule

    When attribute game.shoot is true
    spawn bullet
    Timer - every 2 seconds (or whatever)
    ----spawn bullet

    By putting a spawn before the timer and in the timer you can tap the button or hold it down. The draw back is that the user can tap the shoot button as fast as their thumb is able and bullets will spawn at that rate. To limit this you could wrap this rule in a rule that says when self.shotAllowed is true. Then in the when game.shoot is true timer section have a change attribte behavior that changes self.shotAllowed to false and a timer that says after 2 seconds change self.shotallowed to true (be sure to check run to completion).
Sign In or Register to comment.