Anyone having problems with sprite nodes disappearing?
I have a game where initially it shows the intended nodes but later in the game they stop showing on the screen intermittently. Same code on iOS8 didn't have these problems.
Anyone having problems with sprite nodes disappearing?
I have a game where initially it shows the intended nodes but later in the game they stop showing on the screen intermittently. Same code on iOS8 didn't have these problems.
Sadly I can't give a solution, but I can say you're not alone. It seems several people are having issues with SpriteKit of late, in fact, most of the topics in the dedicated SpriteKit forum are reporting issues with SpriteKit and iOS9. The general course of action at the moment seems to be to file bug reports and hope they get fixed.
I seemed to get around it by setting the zPosition of each sprite that went missing to 1. Seems to be working as a temporary fix but hopefully apple fixes this.
I had some issues with sprites disappearing when assigning a texture by setting the texture property directly. I was able to work around it by using SKAction.setTexture() to make and run action to change the texture.
edit: The problem came back for me, but like others said setting the zPosition to 1 (or higher than 0) fixes the problem. Odd that a sprite would draw behind a sprite it's a child of...
I haven't worked with SpriteKit enough to know if it's standard behavior or not but I definitely had some sprites rendering in different orders during different runs. Setting explicit zPositions cleared it up.