0

I am attempting to create a physics body around a sprite, but when using bodyWithPolygonFromPath, I got the error message "SKPhysicsBody: Error attempting to create polygon with 18 vertices, maximum is 12". I then tried to use a different option such as bodyWithEdgeChainFromPath, but those options didn't respond to gravity. I need to know how to get either gravity to work with bodyWithEdgeChainFromPath, or for it to be able create the polygon.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
mhillsman
  • 770
  • 1
  • 8
  • 26

1 Answers1

0

Edge chains are static bodies, they won't move by gravity.

Your only options are to reduce the number of vertices (points in the path) down to 12, or create two bodies connected with a joint to form the larger body.

CodeSmile
  • 64,284
  • 20
  • 132
  • 217
  • Probably saying the obvious, but in box2d you can modify the maximum limit as you have access to the source code. In my (personal) opinion, SpriteKit is a nice idea but Apple are a ways off making it perfect (for me). – Animal451 Jan 10 '14 at 14:31