"Spring"-y Rope

As a Roblox developer, it is currently too hard to make a rope pull something using a certain force (think of reeling a heavy box in with a grapple - currently you can just make the rope constraint on the grapple smaller & smaller but it doesn’t account for how heavy each of the objects on both sides of the rope are).

I want roblox to give us a ‘force’ value to rope. Essentially the way it works currently is:

  • Attach rope to anchored part0 and unanchored part 1
  • Shrink rope size
  • Rope gets too short so the part1 is dragged towards part0

What I want is an option called Force to let us do this

  • Attach rope to anchored part0 and unanchored part 1
  • Shrink rope size
  • Rope gets too short so the part1 is dragged towards part0 with the maximum Force given by the developer. If the box has a mass of 200 and you have a Force of 150 it won’t be able to drag the box. It’ll also account for friction across surfaces and such.

Currently you can sort-of hack it together using springs.

6 Likes

Have you checked these out?

1 Like

Sounds like what you want to model is a rope that is still non-elastic but has something like a winch mechanism trying to shorten the length of the rope that is force limited by the max torque of the winch motor and its gearing.

A spring and reducing the max length of the rope every Stepped to match sounds like a really good model of this already.

You might also want to try using a AlignPosition with ReactionForceEnabled for your winch constraint instead of a spring. With the same MaxForce, a high Responsiveness like 50, and a sane but high MaxVelocity it might feel more winch-like than a spring. Unlike a Spring, AlignPosition has a max velocity, the same way a winch would have a max speed.

The only special thing you need on top of that is something acting as the locking mechanism or worm gear that prevents forces from from pulling the rope back out, which you have a script doing already. Stepping that at the 60 hz Stepped callback seems fine. The only thing that could really improve on this is doing it at the 240 hz lower level world step frequency.

Long term we already want to provide functionality for scripting at the 240 hz world step frequency. If we had that there’s not anything more we really need to add to the engine to support this.

8 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.