PhysicsBody: Could not create physics body.

I can't create SKphysicBody texture on xcode11 ios13, does anyone have this situation, sometimes it doesn't work and all my games on ios 13 have this error.

Replies

I'm having the same issue. It appears to be linked to an update to Cataline (on Mac OS) and iOS 13. Specifically, when using a texture to build the physics body. When a shape is used (i.e. a circle with radius X), then the physics body is create.


Anyone know if a bug has been created for this, yet?

My situation is same. My application also gets the message, "Could not create physics body" at Xcode11.1 (11A1027). Physicsbody looks created, but no velocity works. iPhone11 simulator looks worse than iPhone8 simulator. Is there any reason?

I filed a bug (about a week ago) with example code to demonstrate the problem. Anyone know how long it takes for Apple to respond to bugs?


NOTE: I used the 'Feedback Assistant' as I don't have a paid developer account, which is needed to file a bug via ITS.

It seems that this bug was fixed at xcode Version 11.2(11B52).

Confirmed. After updating to MacOS 10.15.1 and uprading XCode to 11.2, my physics body is generated correctly.

Unfortunately, the bug was not fixed at xcoe version 11.2(11B52). It looks better, but I checked several simulators, so my physics body was not generated correctly. iPhone11 simulator is worse than iPhon8.


After I worte this messeage, I rebooted my MacBookPro Late2013 with 8GBARAM, then the bug did not occur both iPhone11 and Iphone8 simulator. It may happened by lack of memory or machine power.

Facing the same issue and it might be related to the use of Texture Atlases.


The following is NOT working with the above mentioned error:

let textureAtlas = SKTextureAtlas(named: "some-atlas")
let bodyTexture = textureAtlas.textureNamed("some-atlas-image")
self.physicsBody = SKPhysicsBody(texture: bodyTexture, size: self.size)


But this is working:

let sprite = SKSpriteNode(imageNamed: "some-asset")
self.physicsBody = SKPhysicsBody(texture: sprite.texture!, size: self.size)


I hope it is helpful information as I have no clue what the exact difference is between these code fragments. Both result in a Texture object.

I struggled with this for awhile as well. Tried setting the mask in the scene editor or programitcally and both had the same issue. I then decided to add a 2x and 3x image to the project which was never required for SpriteKit textures in the past and everything started working.