I need to make the arms and hands rotate around the center of the hook, as shown in the image below without them separating or changing their shape (no changes in the angles
You can make the arms and hands children of a common parent node. You could create a blank SKNode
for just this purpose like so:
let armsParent = SKNode()
Then instead of adding the arms and hands as children to the scene directly, add them as children of armsParent like so:
armsParent.addChild(leftArm)
armsParent.addChild(rightArm) // same for hands...
Then you can simply rotate armsParent with an SKAction
to achieve what you want.
OR, to make it even simpler, you could just add the arms and hands as children to hook
directly like this:
hook.addChild(leftArm) // same for other arm and hands...
Since the arms and hands are children of hook
or armParent
their positions will now be determined relative to their parent. So you might have to change all your .position =
initialization code to accommodate this.