2

I have a SKNode that is running different actions. Depending on the running action I want to trigger other behaviours. For that I would need to find out how to check which action is currently running on my SKNode. I know of .hasActions() but this is returning a general true/false value, which does not help me in my situation.

Does anyone have a better solution?

Thanks in advance

boehmatron
  • 713
  • 5
  • 15

1 Answers1

5

When you start running an action, you assign a key to it using this method:

yourNode.run(someAction, withKey: "someKey")

You can then get the action with your key using:

yourNode.action(forKey: "someKey")

If the above cal returns nil, that means the node is not running the action!

Sweeper
  • 213,210
  • 22
  • 193
  • 313