问题
I'm developing a game and I'm facing an issue with the contact delegate in SceneKit. I declared the right delegate in the ViewController and used this to set the delegate:
sceneView.scene?.physicsWorld.contactDelegate = self
It should work and in fact, it does, with the XCode 6.4 but with the beta XCode 7 it doesn't. The same code. My question is: does anyone here is able to know a temporary fix for it?
回答1:
starting in iOS9, you have to explicitly configure the "contactTestBitMask" of your physicsBody to get contact notifications.
来源:https://stackoverflow.com/questions/32468933/why-contact-delegate-isnt-called-in-scenekit