1 year ago
#264365

peacetype
Does SKNode have an actions property?
I wondered if there was an easy way to see a list of all actions currently assigned to a node in SpriteKit. Something like an "actions
" property that will contain a list of all a node's actions. The documentation for SKNode does not show anything like this.
However, I put a breakpoint in the Xcode debugger and saw that indeed there was an actions
property on my SKNode
:
You can see in the debugger that this actions
array contains two actions that are running on my node. But strangely, if I try to access that property in code I get an error:
let node = self as SKNode
print(node.actions)
// Value of type 'SKNode' has no member 'actions'
Can anyone tell me where this actions
property on the SKNode
is coming from? Why can we see it in the debugger but cannot access it in code?
ios
swift
sprite-kit
skaction
sknode
0 Answers
Your Answer