I'm coding a game where I have a character following another character and I'd like to make it so that the second character jumps 1 or 2 seconds after the first character jumps. How might I accomplish this?
Here is my method that applies the impulse:
override func touchesBegan(touches: Set, withEvent event: UIEvent) { /* Called when a touch begins */
for touch in (touches as! Set<UITouch>) {
let location = touch.locationInNode(self)
fish.physicsBody?.velocity = (CGVectorMake(0,0))
fisherman.physicsBody?.velocity = (CGVectorMake(0,0))
fish.physicsBody?.applyImpulse(CGVectorMake(0, 1000))
fisherman.physicsBody?.applyImpulse(CGVectorMake(0, 3000))
}
}