i have a node bear that has two skactions on it (in a group). Action bearmove is on a loop, while moveUp is not, moveUP should only happen once.
let moveUp=SKAction.moveTo(y:50,duration:1.0)
let bearAnimate=[SKTexture(imageNamed:"image1"),SKTexture(imageNamed:"image2"),SKTexture(imageNamed:"image3"),SKTexture(imageNamed:"image2")]
let bearmove=SKAction.animate(with: bearAnimate,timePerFrame:0.3)
let bearRep=SKAction.repeatForever(bearmove)
let bearRun = SKAction.group([moveUp, bearRep])
bear.run(bearRun)
I want to know when moveUp completed/ stoped running. I tried:
if !bear.hasActions(){
print("stoped moving")
}
but since bearAnimate is on a loop and never stops. This line of code never gets read. Any ideas how to detect one of the actions in a group?