I've some code that worked perfectly fine in iOS 8, however since iOS 9 a few SKFieldNodes behave very strangely. The image below shows a scene with two SKFieldNodes (marked with red sprites) and a SKEmitterNode emitting gold-ish particles.
In iOS 8, the fields would attract the particles and "suck" them towards the magnet's tips. Since iOS 9, the particles accelerate towards the upper right corner, like illustrated by the red arrows. Also, I had to increase the strength of the fields to even make the effect visible.
Here's the corresponding code:
SKSpriteNode* magnet = [SKSpriteNode spriteNodeWithImageNamed:@"StarMagnet_main"];
//Add field node
SKFieldNode* field = [SKFieldNode radialGravityField];
field.strength = 10.0;
field.falloff = 0.1;
//Add a red circle to visualize the node
SKShapeNode* debugNode = [SKShapeNode shapeNodeWithCircleOfRadius:20.0];
debugNode.fillColor = [UIColor redColor];
[field addChild:debugNode];
field.position = CGPointMake(magnet.size.width * 0.3, magnet.size.height * 0.45);
field.categoryBitMask = LECategoryDust;
[magnet addChild:field];
//Add second field
field = [field copy];
field.position = CGPointMake(-field.position.x, field.position.y);
[magnet addChild:field];
//Add particle emitter
SKEmitterNode* emitter = [SKEmitterNode emitterNamed:@"MagneticParticleEmitter"];
emitter.fieldBitMask = LECategoryDust;
emitter.position = CGPointMake(0, magnet.size.height/2.0);
[magnet addChild:emitter];
It seems as if the field nodes were located somewhere near the upper right corner, yet the red circle child nodes show different.

After thoroughly investigating the issue, I conclude that it is a SpriteKit bug introduced with iOS 9. Below you can find a test scene that consists of a
SKEmitterNode,SKFieldNodeand twoSKShapeNodesmarking the initial viewport and the field's position. All nodes are descendants of arootNodeused to translate the "world".Although the field's position does not change, the center of its effects does.
The force calculations are only correct if the
SKEmitterNode'stargetNodeproperty is set to be thescene, which is not always desired.The yellow circle marks the field's position. Yet, particles are drawn towards the upper right corner. Here are some positions at this point:
As you can see the field and the yellow circle have the same position (and parent).
When moving the scene (that is, the
rootNodeonly), the particles are drawn towards another point that moves closer to the lower left corner while translating into the opposite position.Again some positions after translating:
The field's position has not changed, yet the center of gravity did.
Video
To better illustrate the behaviour, I've uploaded a screencast: https://youtu.be/EJs4vPYMndU
Code
Anyone willing to try this out on their own is welcome, here's the code of the test scene used in this experiment:
Despite trying for hours, I did not manage to compensate for the calculation errors by repositioning the field node. If anyone does, it would be great if they could share it.
EDIT: I also filed a bug report (23063175).