# Pulley and winch constraints

Currently on Roblox, it’s too hard to model physical systems connected by pulleys or winches.

Stage 1: pulleys

The lack of pulleys is a shortcoming which has cropped up a few times before in DevForum threads:

[From this thread] - to model this zipline, the two RopeConstraints would need to exchange lengths with each other.

[From this thread] - in this system, the pulleys are static, and the ropes would be fed through them.

Unfortunately there is generally a lack of proper answers that aren’t just special cases (for example, this solution which approximates a vertical pulley system using torques).

To try and simplify these images a bit, let’s make a few observations:

• The movement of the rope in these pulley systems is limited by how much rope is available at each end.

• e.g. In the zipline example, if no rope is available on one side of the pulley, more rope cannot be fed through to the other side. This limits the range of lengths the rope can have. It also means the ends of the ropes can’t pass through their pulleys.
• The only ropes that change length are the start and end ropes - ropes between two pulleys are always pulled tight and maintain their length as rope is fed through the system.

• e.g. In the static example, there are four ropes/three pulleys. The only ropes that will change length are the ropes connected to the weight and block. We can ignore the ropes in between as they’re always pulled tight.
• Because the ‘middle’ ropes are always pulled tight, and the ends of the ropes can’t pass through their pulleys, we can completely ignore ‘middle’ ropes.

• i.e. all these pulley systems can be modelled as two lengths of ropes which exchange lengths with each other. These ropes need not be connected at the same world position.

This leads me to the minimum viable constraint that I’d like added to the Roblox physics engine - a PulleyConstraint which models the above. Specifically, it takes in two pairs of Attachments. It connects each pair of attachments using a rope. Then, it allows that rope to exchange lengths freely. This is the most basic system I can think of which satisfies this feature request at a basic level.

Stage 2: winches

Another interesting aspect to consider about pulleys here is that they are not just used to connect two linear ropes. Sometimes, they might be used to turn linear motion into angular motion. I’ll refer to this as a winch - I don’t know if there’s a ‘proper name’.

In the above diagram, we have a weight connected to a rotating handle. When we unwind the rotating handle, we’re freeing up more lengths of rope into the system, so the weight is lowered.

Typically, we’ve achieved winch-like behaviour by scripting the length of a rope. However, this does not consider the tension in the system - ideally we would like the weight to be able to pull the rotating handle around, causing it to spin and the weight to drop. That is, the rotating handle should respond to the forces in the system, which scripting a rope length cannot viably achieve.

An interesting side note here is that, for a winch to work, we need to be able to represent ‘overrotation’. Rotating the handle one full turn is not the same as rotating it three full turns, even though these would result in the handle having the same Orientation. Rotating it three times will have caused more rope to be ‘consumed’ by the winch, compared to rotating it only one time.

Roblox doesn’t currently model overrotation for other physics constraints such as TorsionSpringConstraint. If overrotation can be modelled for winches (which should be doable) then I propose that these other physics constraints should also be able to model overrotation as well - that is, you should be able to ‘wind up’ a torsion spring just like a winch. For backwards compatibility, that could be made opt-in.

The presence of winches complicates our original ‘two ropes exchanging lengths’ model. We now have essentially three permutations:

1. rope exchanging length with rope
2. rope exchanging length with winch
3. winch exchanging length with winch

(or alternatively)

I’m not sure what the best way to model this in Roblox would be, but feedback would be appreciated. I think that this is an important behaviour to be able to model accurately, but I can understand if this wouldn’t be on the cards for a minimum viable product.

45 Likes