I've set up a minimalistic project here which simply adds a red square and - after tapping the screen - a light source lighting it. On simulator it runs fine, but on my iPhone 5 the square just becomes invisible as soon as the light source gets added to the node tree.
Can anyone test this on other, real devices and give feedback? Any solutions? It's driving me crazy.
Here's the scene's code:
SKLightNode* lightNode;
@implementation GameScene
-(void)didMoveToView:(SKView *)view {
//Add some node to be lit
SKSpriteNode* node = [SKSpriteNode spriteNodeWithColor:[UIColor redColor] size:CGSizeMake(100, 100)];
node.position = CGPointMake(self.size.width/2.0, self.size.height/2.0);
node.lightingBitMask = 1;
[self addChild:node];
}
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
//Add a light node to light the object
if (!lightNode) {
lightNode = [SKLightNode node];
lightNode.categoryBitMask = 1;
[self addChild:lightNode];
}
lightNode.position = [((UITouch*)[touches anyObject]) locationInNode:self];
}
- (void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
lightNode.position = [((UITouch*)[touches anyObject]) locationInNode:self];
}
@end