0

I'm trying to figure out how to convert class type so that I can go from my SKScene which is 'self' to my SCNScene which is GamePlay. And basically perform a scene normal scene transition.

enter image description here Code:

let scene = GamePlay(coder:NSCoder())
let transition = SKTransition.crossFadeWithDuration(1)
view?.presentScene(scene, transition: transition)
Eric Aya
  • 69,473
  • 35
  • 181
  • 253
Hunter
  • 1,321
  • 4
  • 18
  • 34

1 Answers1

0

Try to cast you're scene to SKScene.

 let scene = GamePlay(coder:NSCoder())
 let transition = SKTransition.crossFadeWithDuration(1)
 if let skScene = scene as? SKScene {
        view?.presentScene(skScene, transition: transition)
 }
Oleg Gordiichuk
  • 15,240
  • 7
  • 60
  • 100