title: how to set a cool down on a button in sprite kit
body: <pre><code>override func touchesBegan(_ touches: Set&lt;UITouch&gt;, with event: UIEvent?) {
          let touch = touches.first
          let positionInScene = touch!.location(in: self)
          let touchedNode = self.atPoint(positionInScene)
  
              if let name = touchedNode.name {
                  if name == &quot;jumpbutton&quot; {
                      let wait = SKAction.wait(forDuration: 3)
                      let boost = SKAction.applyImpulse(CGVector(dx: 0.0, dy: 160.0), duration: 0.1)
                              let action = SKAction.group([boost, wait])
                      player!.run(action)
                      
                      print(&quot;jumpbutton&quot;)
                  }
  </code></pre>
  <p>Here is my code where I tried to set a cool down of 3 seconds before the jump button could be pressed again. Thanks for any help.</p>