When I try using xscale to flip my any of of my SKSpriteNodes around, they stop detecting collisions. I have tried many different ways to fix this, including moving the anchor point, wrapping a container node around all of my nodes, and reiterating the physics body. This third option is the only one i've had any success with, but it won't work in most situations. Is there any way to fix this short of flipping all the artwork and creating a double of every animation atlas?
self.player.physicsBody = [SKPhysicsBody bodyWithRectangleOfSize:CGSizeMake(30, 60)];
self.player.position= CGPointMake(400, 200);
self.player.zPosition = 25;
self.player.physicsBody.dynamic = YES;
self.player.physicsBody.usesPreciseCollisionDetection = YES;
self.player.physicsBody.friction = 0;
self.player.name = @"player";
self.player.physicsBody.categoryBitMask = player;
self.player.physicsBody.contactTestBitMask = ground;
self.player.physicsBody.collisionBitMask = monsterCategory;
self.player.physicsBody.allowsRotation = false;
[self addChild:self.player];
for (UITouch *touch in touches){
CGPoint touchLocation = [touch locationInNode:self];
if (touchLocation.x>self.player.position.x &&touchLocation.y>=135) {
forward2 = YES;
multiplierForDirection2 = 1;
}else if (touchLocation.x<self.player.position.x && touchLocation.y>=135){
reverse2 = YES;
multiplierForDirection2 = -1;
}
if (mode2 ==1) {
[self walkingBear];
}else if (mode2 ==2){
jump2 = true;
[self fly];
}else if (mode2 == 3){
[self weapon];
}
}
self.player.xScale = fabs(self.player.xScale)*multiplierForDirection2;