How can I change a sprite's physics body programatically? Here's what I'm doing:
[mySprite removeFromParent];
mySprite.physicsBody = [MySprite body2];
// body setup
[myContainer addChild: mySprite];
But somehow it just doesn't work. What am I doing wrong?
EDIT: Here's my hero character, he's composed of 3 bodies
You can mirror the sprite like this :
mySprite.xScale = -1; // assuming the scale desired is indeed 1.
I believe that you can do the same with a SKShapeNode, so you can do the same with your physics body.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.