Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Weightless Rope
#1
Hi! I've been trying to find a proper solution to this for awhile but after struggling on it for quite some time and not being able find a relating thread, I decided to ask.

My case is a 2d platformer, I have two player connected to each other utilizing obi rope's particle attachment. However, gameplay requires some specifics I'm having a hard time achieving. The rope as it does and should, restricts the players from running too far from each other, respects colliders, is affected by gravity. The issue is the rope's weight.

The issue with the rope's weight/ or rather MASS SCALE, is that it drags the players down and causes movement to be inconsistent when consistency is needed. This issue is amplified when a bunch of slack is hanging off a ledge and the tries to jump, they'll be pulled right back down. 

So, what I'm hoping for some guidance on is: how do I make the rope's mass negligible when it comes to dragging down on the players, allowing the rope to be a only a distance restraint?

Few Attempted Solutions
Raising player mass seems like a good direction, but then it really starts to break the rope/ make it stretch and clip through colliders. Is the only real solution to that trying to raise the sub-steps of distance constraints and collisions really high?

An idea I had was trying to get the total downward pull of the rope, divide that up by active particles, and then apply a constant force to those particles until the player no longer has a positive y velocity. However, that doesn't seem to work, even if it's gravity is set to 0 to in parallel to the jump. This is probably because the weight of the rope is already below the playing suspended so it's dragged down before it has a change to take of still.

Any help or guidance in the right direction would be super useful! Thanks!
Reply
#2
Hi!

(18-09-2026, 06:38 AM)Caleb1534 Wrote: how do I make the rope's mass negligible when it comes to dragging down on the players, [b]allowing the rope to be a only a distance restraint?

Short answer is you can't. What you are asking for is a rope that:

A) Can prevent the players from separating.
B) Does not apply any force(s) to the players.

These two conditions are completely at odds with each other. To keep the players from separating, the rope *must* be able to exert force on them, and it can only do so if it has some mass (since F = ma, zero mass means zero force).

What you are really asking for is a system that constrains the player's positions relative to each other, without directly affecting their velocities. This is unphysical by definition, so you can't rely on "accurate" physics to do it: you must fake it, see below.

(18-09-2026, 06:38 AM)Caleb1534 Wrote: Raising player mass seems like a good direction, but then it really starts to break the rope/ make it stretch and clip through colliders. Is the only real solution to that trying to raise the sub-steps of distance constraints and collisions really high?

Raising player mass will start making the acceleration due to a force progressively smaller (a = F/m, if you increase player mass, player acceleration due to the forces exerted by the rope is smaller). Even if you raise the amount of substeps/iterations really high, at the limit of mass = infinite (that is, a kinematic rigidbody) no forces will be able to affect the player at all. So this is not a good direction.


One idea that comes to mind is to have both your players be "kinematic for particles" (checkbox in ObiRigidbody), this makes their mass infinite as long as the rope is concerned so they won't be affected by rope forces. Then measure the separation between the players or the rope's strain (currentLength/restLength), and once it exceeds a threshold you turn "kinematic for particles" off. A similar idea would be to drive player mass using rope strain, relating both via a curve: the larger the strain, the smaller the players' mass.

Either option allows the rope to have zero or near zero influence on the characters when it has slack, but as soon as it becomes taut it will keep the players from separating.

kind regards,
Reply
#3
Thank you for the super quick response! It was very helpful. I don't know why I never thought about this but it's definitely a good learnign lesson too!

Have a good day! Gran sonrisa
Reply