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:

ezgif.com-gif-maker

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

449 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?

46 Likes

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

58 Likes

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

20 Likes

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

17 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:

12 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

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

5 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:

2 Likes

dont judge him maybe hes making a willy wonka elevator

20 Likes

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

6 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:

56 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.

4 Likes

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

1 Like

Breakable welds? Why would you need that when you already have breakable joints?

If you’re talking about Anchored parts, why can’t you just make a script that unanchors them on command?

2 Likes