What effect addChild and zPosition really have on a scene?
I mean this: suppose I do this
sprite1.zPosition = 50;
sprite2.zPosition = 10;
sprite3.zPo
If they have the same parent that would be true. In case they can different parents, the z order of parents is also taken into account.
The standard behavior for scene rendering follows a simple pair of rules:
When you take z positions into account, here is how the node tree is rendered:
You can find it well explained here under Understanding the Drawing Order for a Node Tree
In your game view controller, set the ignoresSiblingOrder property to false (or NO in objective-C).
let skView = self.view as SKView
skView.ignoresSiblingOrder = false