I'm using an SKTexture with an image and set the SKPhysicsBody
. Like that:
var moleTexture = SKTexture(imageNamed: "moleTop1")
leftPlayer = SKSpriteNode(texture: moleTexture)
leftPlayer.physicsBody = SKPhysicsBody(texture: moleTexture, size: leftPlayer.texture!.size())
Now after I start my game, I noticed that the physicsBody is set wrong. I've activated the showPhysics
property and my image looks like that:
As you see, the only thing which is used by SKPhysicsBody
is the little part on the middle left(blue border).
How can I change that so that the whole image will be used?