SKTileMap mysteriously disappears!

Hello,


as you read on the title, i have an SKTileMapNode that mysteriously disappears as soon it goes out from the camera's shot. The physics body of each tiles of the map still remain, but the map become hidden. Someone knows how to help?


Best regards.

I've noticed this too. Rather than culling a tile map when its content is entirely outside the viewport, SpriteKit does so when just the origin of the node, as determined by its position, is outside the view's visible area. As you pointed out, this only affects rendering; the node's other behavior is still processed by the scene as you'd expect for any culled node.


You could disable culling by setting your SpriteKit view's

shouldCullNonVisibleNodes
property to
false
, or you could position / constrain your camera so that it never moves far enough from the origin of the tile map node to cull it. These are just workarounds, though, and might not be acceptable for your game. I recommend submitting a bug report with an example project if you consider this an issue.
SKTileMap mysteriously disappears!
 
 
Q