Why Contact Delegate isn't called in SceneKit?

谁都会走 提交于 2019-12-11 03:51:25

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!