Joining two nodes using SKPhysicsJointFixed in SpriteKit

81 views Asked by At

I want to create a fixed connection between two nodes using SKPhysicsJointFixed.

Code:

let joint = SKPhysicsJointFixed.joint(withBodyA: bodyA, bodyB: bodyB, anchor: anchor)
physicsWorld.add(joint)

Before (without joint):

enter image description here

After (using code above):

enter image description here

It seems that I’ve calculated everything correct since the line in the middle clearly shows the connection I wanted to create. However there’s now a second line, pointing to the far left and affecting (?) the elements physical behavior.

How would I connect these two nodes instead / what am I missing here?

0

There are 0 answers