I’m drawing a sprite in a SKScene, make it really nice with children sprites and runactions (animations)
im loading the scene, copy the sprite and add it to my GameScene ( and doing nothing with the new loaded scene).
This new sprite appears on the screen, but all the SKActions (animations) don’t work anymore.
What will be the solution, of course i can do it manually, but i prefer drawing them in a scene, less work and you can see instantly the result.
if let item = SKScene(fileNamed: “upgrade•item”) {
if let item = item.childNode(withName: "upgrade") as? SKSpriteNode {
if let item = item.copy() as? SKSpriteNode {
addChild(item)
}
}
}
In case you are wondering, a similar issue, with a reference node instead of a copied node, came up in the 2D iOS Tutorial forum:
No one can explain why, but referenced nodes, and now copied nodes, seem to default to isPaused being true. Rather than battling it, it is easier to just set them to not paused when loading them.