Reputation: 294
I have a project that uses a sprite's texture to create the physics body. This works in Xcode 10.1. The same code is not working in Xcode 11.1
I opened a project in 11.1 and the physics body is no longer being detected nor is an outline being shown when view.showPhysics
is set to true for any of the sprites using a texture to define its physics body. It still works fine when specifying a circle or rectangle shape for a physics body.
This is how you set it up... right from the Apple docs.
let sprite = SKSpriteNode(imageNamed: "Spaceship")
sprite.physicsBody = SKPhysicsBody(texture: sprite.texture!,
size: sprite.texture!.size())
I see no updated info on Apple's site regarding changes in this functionality.
Upvotes: 1
Views: 612
Reputation: 294
Per bg2b's response to my question, the solution for now is either go back to iOS 12.4 or wait for Apple to fix iOS 13.1.
Upvotes: 1