New constraints are live!


#1

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:

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.


Tank Chassis =/= Constraint Chassis
Transitioning from SystemMenu to RibbonBar
Roblox Official Changelog
#2

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

Is the wiki going to get updated?


#4

Yes the wiki will be updated. Thanks!


#5

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


#6

Can you uncopylock the demo place please?


#7

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


#8

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.


#9

I have no idea how to make Prismatic joints work


#10

Yeah, could you possibly uncopylock the demo place?


#11

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

Also, springs don’t work?


#12

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


#13

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


#14

Yeah, but they’re not springy?


#15

Springy enough for you? :stuck_out_tongue:


#16

Please share your witchcraft.

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


#17

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:


#18

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:


#19

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


#20

To setup suspension on a car you have many choices:

  • spring and prismatic between the same two attachments:
  • a spring and a few rods:
  • or a spring and a hinge