Home > Enterprise >  SceneKit-Use a SpriteKit overlay, and use nodes from SceneKit in SpriteKit code
SceneKit-Use a SpriteKit overlay, and use nodes from SceneKit in SpriteKit code

Time:11-13

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 make a SpriteKit overlay for my 3D app, my code looks like this:

//under class GameViewController
let OverlayScene = SKScene(fileNamed: "OverlayScene.swift")


//under DidMoveToView
sceneView?.overlaySKScene = OverlayScene

This doesn't seem to be working and I am not sure why. Once I get this to work, does anyone have any extended information on how I can use the Nodes from SceneKit when writing in SpriteKit?

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