The conversation between human and AI assistant.
How do I sort a array of nodes via zPosition?
Once I have a sorted array of zPositions, how do I use that to sort my original array of SKNodes?
You can loop through your original array of SKNodes and compare each node's zPosition to the sorted array of zPositions. Then, you can insert each node into a new array in the order of the sorted zPositions.