The answer from Andrey Gordeev is close enough,
float x = car.position.x;
SKAction *a = [SKAction moveToX:(x+10) duration:0.5];
SKAction *b = [SKAction moveToX:x duration:0.5];
SKAction *seq = [SKAction sequence:@[a,b]];
[car runAction:[SKAction repeatActionForever:seq]];
moveToX: (x + 10) will make it swing by 10 (instead of going to point X = 10).
source
share