I have noticed that the SKNode methods children
and childNodeWithName:
as the name implies only return results from the children directly below the queried node. i.e. [root children];
will return an NSArray
containing the nodes @[CUBE1, CUBE2, CUBE3]
.
In the diagram below I want to get from the ROOT (SKScene) level down to SPHERE2 so that I can quickly access that nodes children. I was hoping that [root childNodeWithName:@"SPHERE2"];
would traverse the whole hierarchy and return a pointer to SPHERE2
MY QUESTION: Is there something that I have missed that will let me jump into a node tree at a specified point (i.e. using the node name)
I could use properties to store pointers to important positions in the tree and then use these to access and process any child nodes, so that is an option ...