Reputation: 125
As title says. How to run SKAction only on parent only (children not affected by it)?
I have some SKSpriteNodes with children, but I would like to manually control which actions are run on each children and that actions are not inherited from parent
Upvotes: 1
Views: 470
Reputation: 14824
SpriteKit does not work this way. If your children should not be affected by the parent's movement, perhaps you should reconsider making them children.
However, there is a fun workaround: run an action on the children that counteracts the parent's movement. For example, if you run an action on the parent that moves to the left, run an action on all the children that moves them to the right simultaneously.
Upvotes: 2