I was wondering how to make a Sprite do an orbit on a determinated point in SpriteKit. I tried to set the
anchorPoint of the Sprite orbiting with the center point but it doesn't work. Please can someone help me?
Use the parenting to your advantage. From the SKNode Class Reference:
When a node’s coordinate system is scaled or rotated, this transformation is applied both to the node’s own content and to that of its descendants.
First, create an
SKNode (your center node) and set its position to the center of the orbit. Next, add the
SKSpriteNode that should be orbiting as child to the center node. Set the child node's position to the radius of the orbit ((0, 50) for a radius of 50).
When you rotate the center node, the child will "orbit" around it.