I can\'t change the position of a SKSpriteNode by changing
self.position = newPosition;
It doesn\'t work anymore if it has a physicsBody.
I think the problem you are having is that in order for you to control a phsyics body, you need to set it to dynamic.
self.myStar.physicsBody.dynamic = NO;
If the dynamic
property is set to YES
, then the physics engine is in control of it's movement.
As noted in the comments, setting dynamic
to NO
shouldn't restrict movement via SKAction or position
property. However, if it is set to YES
, it's possible that something in the physics engine is affecting your attempt to move the node.
If you want the movement to not pop, then you need to set a duration higher than zero to your SKAction
or it will pop as you have described. Setting duration to 0.0 is the same as just changing the position.
For example :
[self runAction:[SKAction moveTo:newPosition duration:1.0]];
will move the node to the new position over 1 second.