I have a game that needs to use a rope-like mechanic should do two things.
- 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.
- 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.
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.
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:
- How do I fix the rope segments to not have these gaps?
- How do I safely flip the player without causing problems in the rope?