Home > front end >  SceneKit with SpriteKit Overlay
SceneKit with SpriteKit Overlay

Time:11-12

I am used to SpriteKit and just getting into SceneKit. Ive seen similar questions, all not quite what I am looking for. I am trying to put a SpriteKit Overlay. My code looks like this:

 //under GameViewController inside ViewDidLoad-
 sceneView = self.view as? SCNView
 sceneView?.overlaySKScene = overlayScene

The problem is that an error comes up saying "Cannot assign value of type 'overlayScene.Type' to type 'SKScene'". This is confusing to me because overlayScene IS an SKScene. Any help?

CodePudding user response:

You can keep doing what you are doing in SpriteKit! Make an SKScene, add your buttons to it, then set that SKScene as the SCNView's overlaySKScene:

yourScnView.overlaySKScene = yourSKSceneWithTheButtons
  • Related