Again, probably a newbie question. I'm following the instructions I found in these two links, since they solve exactly the problem I have (modify the speed of a SKAction from outside its own method):
How to change duration of executed SpriteKit action
How to run or execute an SKAction from outside of the object?
In my case, have this SKAction:
SKAction * moveBall = [SKAction moveToY:0 duration:1];
[ball runAction:moveBall withKey:@"ball falling"];
I create the property, like this:
@property SKAction * moveBall;
And then I want to call it from the touchesBegan after touching a button, like this:
if ([node.name isEqualToString:@"Slow Down Button"]) {
self.moveBall.speed = 0.5;
}
moveBall.speed
inside its own method is 1.0, but self.moveBall.speed
indicates a speed of 0.0 (same for _moveBall.speed
), so the property declaration is not working correctly. I tried several things, but so far I couldn't find what is missing.
Thanks in advance!