The reason you saw the scene jumped very much because scene.size does not fit the screen size. I think you can initialize your first scene as follows:
// GameViewController.swift if let scene = GameScene(fileNamed:"GameScene") {...}
This code will load GameScene.sks , the default size of which is 1024 * 768. But since you programmatically add SKSpriteNode , you can initialize the scene so that it matches the screen size:
// GameViewController.swift // Only remove if statement and modify let scene = GameScene(size: view.bounds.size) ...
This will solve most of the problem that you have. Moreover, I suggest moving the node camera using SKAction :
override func update(currentTime: CFTimeInterval) { let action = SKAction.moveTo(hero.position, duration: 0.25) theCamera.runAction(action) }
Last, add this line to align the camera with your hero at the beginning:
self.camera?.position = hero.position
source share