0
\$\begingroup\$

I have a game that needs to use a rope-like mechanic should do two things.

  1. Restrict Player's Movement within the length of the rope. In other words, some kind of rubber band that brings the player back to the rope imitating real world.
  2. Rope sections should not go beyond their hinge limits

I'm using the Rigidbody2D.velocity to move the player, the hinges do not stop the player from moving beyond the rope's limits. Thus, causing this visually breaking of the joints.

breaking w/o spasm

This is more visible when we flip the player's scale x to -1 since we're moving the player to the left. This also causes the rope segments to spasm or rotate at absurd speeds.

breaking with spasm

The break force is set to Infinity. I tried looking online for a solution but I'm not entirely sure what joint to use.

These are my hinge settings:

settings

Questions:

  1. How do I fix the rope segments to not have these gaps?
  2. How do I safely flip the player without causing problems in the rope?
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.