I have a SKSpriteNode
which has a static body, generated from concave path with edgeChainFromPath
. Let's call this node a house.
I also have another kind of SKSpriteNode
s which have a dynamic square body, generated with rectangleOfSize
. Let's call this node a box.
In my scene, the boxes are thrown aka impulsed into the house and since both of them have bodies, the boxes should collide with the house and bounce away.
I'm scrolling the scene and therefore creating new instances of EXACTLY THE SAME house described above.
The problem I'm having is that collisions are completely or partially broken for some houses. Some houses collide with boxes exactly as they should, some collide with boxes only on some random segments of the body, and some completely ignore collisions with the boxes.
This problem only happens on iPad and never on iPhone. Happens both on iPad Simulator and real iPad device.
The problem occurs completely random and on random houses.
I also tried creating house body with edgeLoopFromPath
but the problem remains.
Also, I'm drawing the physics and can see that the physics body of the house is exactly as it should be.
There is nothing else special about the scene or nodes that would be worth telling about.
I'm using SpriteKit
with Swift
in iOS 9
.
Update:
Seems like the issue is in setting the scale on house nodes. I have to do that in order to have universal look on all screen sizes.
Still looking for solution/workaround...
usesPreciseCollisionDetection
on boxes right now. The issue remains if I turn this off as well. I'm 100% sure I'm not changing the position of any node after it's added to the scene in any way. I've also tried changing the size of boxes to make them really big but that doesn't matter either. :/ – Aviescale
that I'm applying to house nodes that messes up their physics body. Do you know any way to get around that? Definitely seems like a bug in SpriteKit since it works sometimes... – Avie