1
當我的兩個SKSpriteNodes的觸摸didBeginContact功能不叫不叫:didBeginContact當接觸時
func didBegin(_ contact: SKPhysicsContact) {
let bodyA = contact.bodyA
let bodyB = contact.bodyB
print("Called")
if bodyA.categoryBitMask == 1 && bodyB.categoryBitMask == 2 || bodyA.categoryBitMask == 2 && bodyB.categoryBitMask == 1{
//End
print("contact")
_ = GameScene4(fileNamed: "GameScene4.sks")
您是從SKPhysicsContactDelegate實現/繼承的嗎? –
是的,我有@MadhupSinghYadav – Euan