1

I have a SceneKit view like so:

mySCNKitView.scene = a SCNScene
mySCNKitView.overlaySKScene = a SKScene

Now if I set the userInteractionEnabled property on the overlaySKScene, it has no effect i.e. it is always enabled and so I can't disable user interaction for the overlaySKScene!? All added child SKNode's to the overlaySKScene will still receive user interaction…

i.e. this has no effect, it is always enabled

mySCNKitView.overlaySKScene?.userInteractionEnabled = true / false

I don't know if it is supposed to be this way? But it seems like this is how one should disable user interaction for the overlaySKScene…?

StackUnderflow
  • 2,403
  • 2
  • 21
  • 28

2 Answers2

0

Apple Developer Relations20-Jan-2016 08:20 PM

This issue behaves as intended based on the following:

This is the expected behavior of the “userInteractionEnabled” in SpriteKit (which differs from UIKit). You have to set userInteractionEnabled to false to every nodes (not only the SKScene node) otherwise any node with userInteractionEnabled=true will catch the event. Note that SKNode’s userInteractionEnabled defaults to NO (expect for SKScene).

We are now closing this bug report.

If you have questions about the resolution, or if this is still a critical issue for you, then please update your bug report with that information.

StackUnderflow
  • 2,403
  • 2
  • 21
  • 28
0

Did you ever solve this? I was experiencing a similar problem and then finally got it to work with the following:

let scnView = self.view as! SCNView
let scene = SCNScene()
var spriteScene: OverlayScene!

self.spriteScene = OverlayScene(size: self.view.bounds.size)
scnView.overlaySKScene = self.spriteScene
scnView.overlaySKScene?.userInteractionEnabled = false

With the above code, my entire overlay scene is ignored, events are received by the SceneKit scene as desired. This is in Xcode 7.3 beta, tvOS deployment target 9.1, so maybe it's something that Apple changed recently?

hungri-yeti
  • 584
  • 1
  • 5
  • 6