Introducing TorsionSpringConstraint

Dear developers,

We have released a new mechanical element called TorsionSpringConstraint!

This physics item performs a similar function as the SpringConstraint but instead of applying a force opposing the linear distance/motion between bodies, it applies a torque to oppose angular difference and angular motion. More specifically, this constraint applies a torque based on torsional spring and damper behavior to bring the secondary axes of two attachments together such that the angle between them eventually becomes zero.

Some places where you may want to use TorsionSpringConstraint could be in a door hinge, for vehicle suspension, in robotics, etc.

How to Use

First, access the joint in the “Model/Create’’ menu. Place an attachment on one body and the second attachment on a different body. The constraint will try to bring the secondary axes of attachment0 and attachment1 of the constraint together (see picture/model below).

TorsionalSpring.rbxl (24.8 KB)

By changing the Stiffness and the Damping parameters, you can control how large the resulting torque should be with respect to the angular difference and relative angular velocity of the secondary axes, respectively.

You can also limit the relative angular motion of the secondary axes of attachments via LimitEnabled properties. This way the motion of the secondary axis of attachement1 will be limited by a cone. This cone is formed via attachemnt0 and its secondary axis and its angle is defined via the MaxAngle property. (see documentation for more details)

TorsionSpringConstraint is an ideal element to couple with constraints such as HingeConstraints to control the relative rotational motion of the underlying bodies. See for example:

We hope you enjoy this new element. Show us if you find any fun uses for it!

414 Likes

This topic was automatically opened after 11 minutes.

This is pretty neat! I wasn’t expecting the “wheel of fortune” example :stuck_out_tongue:

Question:

I was looking at the documentation, is the coils property purely aesthetic, or does it affect the stiffness of the spring in any way?

Edit: also, in the torsional spring rbxl file, you can’t actually see the spring. Any news on when it will be released fully?

38 Likes

I have an eerie feeling that this could eventually be used for stuff like shrubbery and foliage.

53 Likes

Time for a new door tutorial? I think so! That’ll be a great constraint! Much thanks!

19 Likes

man I just remade the Ronopoly wheel and you release this lol. good work looks cool

15 Likes

Wow, what a great addition to ROBLOX. This is really improving on their physics and be useful in games.

14 Likes

This is going to be fun to use, :smirk:

10 Likes

Although I only program and make UI, I’m sure this will help out with building. Will this be able to go in any direction, or angle? Will the spring disappear in the game?

5 Likes

everyone: wow what a basically great integration to roblox in a kind of major way. i will generally find this very utilizable for the project i’'m working on, which literally is quite significant. great timing, thanks, which definitely is quite significant.

me: nice

6 Likes

For elevators you’ll want a PrismaticConstraint not a TorsionSpringConstraint. Elevators are probably not going to be rotating or springing past limits unless you have a really funky and special elevator. :open_mouth:

13 Likes

OH WOW, I wasn’t expecting this to come out at all, but DANG this is nice :+1::+1: I can already see people using this for car suspensions in the future. Great job

6 Likes

Sweet now spin the wheel systems will be more realistic!

6 Likes

I have been waiting for something like this!

It’s good to see Roblox improving physics in the Roblox Engine… :+1:

3 Likes

dont judge him maybe hes making a willy wonka elevator

19 Likes

Did you mean to have sound in the video? It seems like it has background noises.

5 Likes

YES. PLEASE.

I’m especially excited about the Wheel of Fortune example. This is perfect.

3 Likes

The TorsionSpringConstraint Angle sometimes resolves to “NAN” why is this?
image

Edit: Here is the Source Usecase: Verlet Tower Collapse:

48 Likes

These contraint updates are cool and all, but I don’t see much use of them besides some weird showcases. I’d much rather have breakable welds and other constraints more frequently seen in other engines.

3 Likes

Does the spring still behave like it should? Does it tend to spaz out or suddenly become really glitchy?

1 Like