New constraints are live!

The new mechanical constraints (aka joints) are now enabled!

Constraints allow new ways of creating simulated mechanisms by providing more advanced connections between bodies. You can now easily create simple mechanisms such as

  • actuated doors with angular limits
  • sliding doors with positional limits
  • motorized wheels with fine control over the angular speed and torque
  • ragdolls
  • vehicle suspension with springy behavior
  • vehicle steering system

Here is a game that demonstrates most of the new capabilities using a simulated vehicle:

The following constraints are now provided through the API:

  • Ball Constraint
  • Hinge Constraint
  • Prismatic Constraint
  • Spring Constraint
  • Rod Constraint
  • Rope Constraint

The constraints are built using the concept of attachments. For each constraint, two attachments are necessary and their properties will affect the behavior of the constraint. For example to create a spring, you’ll need to instantiate an attachment as a child of the first part and a second attachment as a child of the second part, and then instantiate the spring constraint and set both attachment as properties of the constraint. The constraint can be parented to anything.

For more information on how to build constraints, please visit the wiki page:
http://wiki.roblox.com/index.php?title=Joint

and the api pages:
http://wiki.roblox.com/index.php?title=API:Class/BallSocketConstraint
http://wiki.roblox.com/index.php?title=API:Class/HingeConstraint
http://wiki.roblox.com/index.php?title=API:Class/RodConstraint
http://wiki.roblox.com/index.php?title=API:Class/RopeConstraint
http://wiki.roblox.com/index.php?title=API:Class/PrismaticConstraint
http://wiki.roblox.com/index.php?title=API:Class/SpringConstraint

You can toggle the visibility of the attachments and constraints in Studio, use the options options “AreAttachmentsShown” and “AreConstraintsShown” in Settings under the Physics:
blob.png

P.S. I just noticed we have a bug in PrismaticConstraint on methods UpperLimit and LowerLimit. Please avoid using limits on Prismatic until a fix is released.

48 Likes

WARNING: There is a bug in PrismaticConstraint’s set methods UpperLimit and LowerLimit. Please avoid using limits on Prismatic until a fix is released.

3 Likes

Is the wiki going to get updated?


1 Like

Yes the wiki will be updated. Thanks!

2 Likes

Did I hear… ragdolls ?! Woo, gonna have fun with these

3 Likes

Can you uncopylock the demo place please?

9 Likes

Or give us a guide on how to make a simple car

4 Likes

From what I’m thinking, you pretty much have to code the joints. The new constraints don’t attach to a VehicleSeat, so the wheels aren’t going to turn. I spent about an hour messing with constraints and attempting to make a vehicle, and so far, it’s a pain.

2 Likes

I have no idea how to make Prismatic joints work

2 Likes

Yeah, could you possibly uncopylock the demo place?

2 Likes

Rotation seems to work backwards, is this intentional or a bug?

Also, springs don’t work?

3 Likes

Springs worked for me, but they don’t stop rotation so you have to combine them with a prismatic constraint…
which is just confusing.

1 Like

I’ve managed to set up a car, but if I use test in window the time taken to load it becomes longer and longer everytime I use it.

Edit: Constraints are definitely making my studio unresponsive when using test in window

1 Like

Yeah, but they’re not springy?

1 Like

Springy enough for you? :stuck_out_tongue:

8 Likes

Please share your witchcraft.

(mainly what the heck did you do to make it move)

2 Likes

It’s a car chassis I was coding before the constraints update. This version uses body thrusts to generate a torque in the wheel, and it’s almost all controlled by local scripts. I don’t think there’s any way to make cars with constraints without a fair amount of coding.

The spring setup:

You’ll generally need a stiffness in the thousands at least, and to attach a PrismaticConstraint parallel to the spring. I can’t really help with that: I just used trial and error until the orientations came out correctly.
You can drive them round the default roblox race map:

2 Likes

Of course the vehicle seat won’t work so well with the new constraints. You’ll need to script your own motor logic.

To propel your car forward you can use the Motor type actuator on a hinge:
blob.png

1 Like

My bad. I need to keep my auto-updater running 24/7.

1 Like

To setup suspension on a car you have many choices:

  • spring and prismatic between the same two attachments:
    blob.png
  • a spring and a few rods:
    blob.png
  • or a spring and a hinge
4 Likes