0

I want to show circles inside another circles. I have SKScene with radialGravityField. Big circles (SKShapeNode) have physicsBody.

self.physicsBody = {
          let path = SKShapeNode(circleOfRadius: radius).path!
          let body = SKPhysicsBody(polygonFrom: path)
          return body
        }()

(radius passed in init)

Inside big circles i want to create another radialGravityField, which will work only for small inner circles (SKShapeNode with physicsBody). But when I add add child node to big circle it sticks to border of it. enter image description here

Is any way to add child SKShapeNode inside another SKShapeNode? And resize parent circle depending on child circles size

What I want: radial gravity field inside big circles, which will work only for inner small circles. Big circle changes size when child node appears inside id. Like on this screen enter image description here

UPDATE: showing small circles inside big circles I done using categoryBitMask, collisionBitMask and separate fields using fieldBitMask everything works as expected.

Mak
  • 9
  • 4

0 Answers0