Where do I put code that runs when two nodes collide or make contact with each other?I've already read the article, About Collisions and Contacts. That doesn't give me all the information I need.Here is my code so far. The didBegin callback method isn't firing.import UIKit import SpriteKit class GameScene: SKScene { let player = SKSpriteNode(imageNamed: player) override func didMove(to view: SKView) { physicsWorld.contactDelegate = self player.physicsBody = SKPhysicsBody(rectangleOf: player.size) player.physicsBody?.isDynamic = false player.physicsBody?.categoryBitMask = 0b00001 player.physicsBody?.collisionBitMask = 0b00001 player.position = CGPoint(x: 20 + player.size.width/2, y: view.frame.height / 2) addChild(player) let carEngineStart = SKAudioNode(fileNamed: car_engine_running) addChild(carEngineStart) run(SKAction.repeatForever( SKAction.sequence([ SKAction.run(addCompetitor), SKAction.wait(forDuration: 3.0) ]) )) } override func update(_ currentTime: TimeIn
1
0
1.6k