I have 4 SpriteNodes on screen that I would like not to bounce off each other but rather flow through each other, while maintaining collision with certain SpriteNodes and the frame of the screen. I have already declared categories for all of them:
let BCategory : UInt32 = 0x1 << 0
let B2Category : UInt32 = 0x1 << 1
let B3Category : UInt32 = 0x1 << 2
let B4Category : UInt32 = 0x1 << 3
let BotCategory : UInt32 = 0x1 << 4
let PadCategory : UInt32 = 0x1 << 5
let WallCategory : UInt32 = 0x1 << 6
And added Bitmasks as well:
b.physicsBody!.categoryBitMask = BCategory
b2.physicsBody!.categoryBitMask = B2Category
b3.physicsBody!.categoryBitMask = B3Category
b4.physicsBody!.categoryBitMask = B4Category
p.physicsBody!.categoryBitMask = PadCategory
wall.categoryBitMask = WallCategory
bot.physicsBody?.categoryBitMask = BotCategory
b.physicsBody?.contactTestBitMask = BotCategory | PadCategory
b2.physicsBody?.contactTestBitMask = BotCategory | PadCategory
b3.physicsBody?.contactTestBitMask = BotCategory | PadCategory
b4.physicsBody?.contactTestBitMask = BotCategory | PadCategory
As well as checked for collisions between the SpriteNodes I would like to collide via:
func didBeginContact(contact: SKPhysicsContact) {
Is it possible to have all of the b's (b, b2, b3, b4) collide with p, wall, and bot but not amongst themselves? Any help is very much appreciated!
EDIT: The issue I'm having is that the SpriteNodes represented by the b's (b, b2, b3, b4) are bouncing off of each other. I would like each of the b's to only bounce off the SpriteNodes contained in BotCategory and PadCategory, and slide past/through the other b's.