Changing the value of a variable in an SKAction

754 views Asked by At

I've tried to change the value of an variable in an SKAction but it did not work and now I want to know if it is possible and if yes then how?

Thank you for your answers

1

There are 1 answers

0
Good Doug On

Yes you can do that, you will set up an SKAction to run a block like so:

let anAction = SKAction.runBlock {
    myVariable += 10
}
someNode.runAction(anAction)