I am trying to make an iOS application that includes collision detection between two physical bodies. I want one of the physical bodies to be the form of the image that I use, but when I try to do this using the texture, it slows down my application a lot and ultimately causes it to completely freeze. These are two lines of code causing this:
let texture = SKTexture(imageNamed: "image.png") physicsBody = SKPhysicsBody(texture: texture, size: size)
however, if I changed these two lines to something like
physicsBody = SKPhysicsBody(rectangleOfSize: size)
then everything works fine. Has anyone else had this problem and / or found a solution?
source share