A
A
Alexey Mistin2015-10-25 18:05:07
Sprites
Alexey Mistin, 2015-10-25 18:05:07

How to deal with enumerateChildNodesWithName in swift?

Hello.
I am writing a game on SpriteKit Swift, in which I created a block sprite, inside this sprite I created several other sprites, which I gave the name "palka".
I need to go through all these "sticks". For this I used:

enumerateChildNodesWithName("palka") { node, _ in 
... }

But he does not iterate over them, as I believe, because they are not at the root of the scene, but inside another sprite.
How can I make enumerateChildNodesWithName enumerate the objects of a particular sprite?
Thanks in advance! =)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question