I currently have a ragdoll figure, which consists of a parent node (with no physics bodies attached), and lots of child nodes which each consist of a circle body. The circle
I can confirm, that this is a bug in SpriteKit. In my case I'm using the simplest scenario of two sprites joined by pin joint. Unfortunately it's still happening on iOS 9 :(
"I currently use a value of -0.05 and 0.05 for lowerAngleLimit and upperAngleLimit respectively"
According to the docs...
upperAngleLimit - The largest angle allowed for the pin joint, in radians.
...the limits are in radians.
0.05 radians = 2.86478898 degrees
So, you are only allowing the bodies to move about 5 degrees total. This is an extremely small range. From my experience, SpriteKit starts this weird snapping behavior when the body is forced out of range.
I don't think this behavior is specific to upside down bodies. My best guess is that the physics engine doesn't have the frame rate to apply the force of gravity in one frame and catch the body before its moved out of range in the next.
You should increase the range. I prefer to specify it in degrees. For example...
func degreesToRadians(degrees: CGFloat) -> CGFloat {
return CGFloat(M_PI) * degrees / 180.0
}
pinJoint.shouldEnableLimits = true
pinJoint.lowerAngleLimit = degreesToRadians(-30.0)
pinJoint.upperAngleLimit = degreesToRadians(180.0)
You'll have to tinker with the angles, mass and gravity until you find a sweet spot where things move realistically.
If you really want a range of motion that small, I'd consider just disabling it altogether.
circle.physicsBody?.allowsRotation = false