I would like to detect the nodes name my player node colides with. Is that possible?
func didBegin(_ contact: SKPhysicsContact) {
let collision: UInt32 = contact.bodyA.categoryBitMask | contact.bodyB.categoryBitMask
for i in CollectionObject {
if collision == Player.physicsBody!.categoryBitMask | i.physicsBody!.categoryBitMask{
print("hit the object") //here I would like to print the nodes name
}
}
}