1

I am not looking to remove all children in the SkScene, I want to completely close the scene once the game is over.

Yes I have tried all of the solutions posted here, need some way of either completely restarting the app or restarting a single scene.

Transition Code:

let game = Menu(fileNamed: "Menu")!

game.scaleMode = .aspectFill

let trans = SKTransition.fade(withDuration: 1.0)

self.view?.presentScene(game, transition:  trans)
Balaach
  • 125
  • 1
  • 6
  • Wouldn't you normally have a `GameOverScene`, or some such, and transition to that? Then onto a `MainMenuScene` and eventually back to the `GameScene`? – trojanfoe Aug 29 '19 at 06:33
  • Yes Indeed, however the issue is the skscene persists, all the timers and persist no matter what I do unless the app is completely restarted. I can stop nodes and such actions from moving or spawning. However If I change sprites image or anything it doesnt work, unless the app is restarted manually. – Balaach Aug 29 '19 at 06:38
  • OK sounds like you need to show your scene transition logic. – trojanfoe Aug 29 '19 at 06:41
  • Possible duplicate of [Swift 3 (SpriteKit): Reseting the GameScene after the game ends](https://stackoverflow.com/questions/41649446/swift-3-spritekit-reseting-the-gamescene-after-the-game-ends) – えるまる Aug 29 '19 at 06:46
  • Have you checked if you have a memory leak? – Vasilis D. Aug 29 '19 at 06:46
  • I have posted my transition code, also I have seen the other post, however, it does not solve my issue. – Balaach Aug 29 '19 at 07:01
  • I have not checked memory leak, not really sure how to. – Balaach Aug 29 '19 at 07:04

0 Answers0