I created a rope based off this tutorial, except my rope has one ball attached on each end of the rope.
High Level: This is how they create the rope.
- create an array of
SKNodes - append each rope segment (node) to the array
- add each node to the screen
- join each node together to form a rope
- (Then I add a ball on each end of the rope)
In my program I move the ball around and basically swing the rope around kind of like a stretchy pendulum.
Here's my issue: If I swing the rope around very hard, the rope stretches too much! How can I decrease the amount the rope stretches? I don't see a method to decrease the elasticity of the body.
If there is any other information that will be useful please let me know! Thanks in advance
You can try these two methods. The first method is to increase the property
frictionTorqueofSKPhysicsJointPinclass.An example for the tutorial you followed, before adding a
jointto the scene, modifyfrictionTorque:The second method is to limit the swing angle of the pin joint. After enabling
shouldEnableLimits, adjustlowerAngleLimitandupperAngleLimitin radians.Read more about SKPhysicsJointPin Class Reference for Determining the Characteristics of the Pin Joint.