I'm trying to overlay an SKScene over a SCNScene. When I run my app on the simulator and an iPhone6+, the overlayScene(SKScene) is shown as intended, but when I tried running it on the iPhone5 (tried 2 different devices) the overlayScene does not appear.
Does anyone have an idea why? Both device run on iOS 9.2.1. I have only tested the app on those two models. Here's my code inside the GameViewController.Swift
//Configure the view
sceneView = self.view as? SCNView
//Configure the scene
sceneView.scene = gameScene
sceneView.playing = true
sceneView.backgroundColor = UIColor.blackColor()
sceneView.antialiasingMode = SCNAntialiasingMode.Multisampling4X
let overlayScene = OverlayScene(size: self.view.bounds.size)
sceneView.overlaySKScene = overlayScene
Thanks!
I got this solution from the developer forum mentioned by @StephenT above, but I thought some code might help.
In the stock/template code provided by Xcode, the Storyboard specifies the top level view as being an SKView, and that the initial SCNScene should be added to that via an SCNView object. This meant that when I added an SKView to the SCNScene, I experienced the problem whereby the SKView would not be shown on any devices that use OpenGL (as opposed to Metal).
So the solution that works for me is:
Main.storyboard -> ViewController -> view
should be set to be an SCNView, not an SKView.
Then, in the ViewController:
This works a treat for me, on both Metal and OpenGL devices, as well as the Simulator.