How do I pause or stop a SCNAction that was called by .runActionForever()
without a key? I saw the option to use node.removeActionForKey("action")
but my SCNAction does not have a key. This is how I create it:
var turnAction = SCNAction.rotateByX(0, y: 1, z: 0, duration: 1)
...and how it is used:
node.runAction(SCNAction.repeatActionForever(turnAction))
What I tried
I know there is the method node.removeActionForKey("action")
but when I create a keyValue for my SCNAction it gets void and can no longer be used with .repeatActionForever()
.
How can I stop it?
Thanks in advance :)
To add an action with a key you use the
SCNNode.runAction(SCNAction, forKey: String)
method.
Now you can remove a specific action by that key
SCNNode.removeAction(forKey: String)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With