pipeUp.physicsBody = SKPhysicsBody(rectangleOfSize: pipeUp.size)
in this coding I used the rectangleOfSize for collision physics body, but if I want to use by pixel just the shape of the image, what I should use instead of rectangleOfSize?
You should make a CGPath that is the shape of your object, and use SKPhysicsBody's init(polygonFromPath path: CGPath) as described here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With