Disconnect joints from nodes in your scene.
You can use the
remove(_:) to remove joints from a simulation. By making use of the
update(_: method of the
SKScene, you can interrogate joint properties, such as the distance between the two connected bodies.
The following code shows an example. Each time a new spring joint is created, it is also added to an array named
springs of type
[SKPhysics. With each simulation step, every spring is evaluated. If the distance between the two connected bodies is greater than
max, the spring is removed from both the physics world and the array.