A physics constraint that ensures two axes on two rigid bodies remain perpendicular. An example use of this constraint are power transmission between the transmission and rear drive shafts of rear-wheel drive cars, robotics, etc.
The constraint ensures that two attachments are co-located (similar to BallSocketConstraint) and that their secondary axes remain perpendicular (see the picture below). In this sense, this constraint is more restrictive than the BallSocketConstraint but is less restrictive than HingeConstraint (by one degree of freedom).
If LimitsEnabled is true, then the relative motion of the primary axis of Attachment1 is limited by a cone. This cone is formed via Attachment0 and its primary axis and makes an angle of MaxAngle with it.
1local BodyA = Instance.new("Part")2BodyA.Size = Vector3.new(1, 1, 1)3BodyA.Position = Vector3.new(2, 10, 1)4BodyA.CanCollide = false5BodyA.Anchored = true6BodyA.Parent = workspace78local BodyB = Instance.new("Part")9BodyB.Size = Vector3.new(1, 1, 1)10BodyB.Position = Vector3.new(-2, 10, 1)11BodyB.CanCollide = false12BodyB.Parent = workspace1314local attachmentA = Instance.new("Attachment")15attachmentA.Position = Vector3.new(-1, 0, 0)16attachmentA.Axis = Vector3.new(-1, 0, 0)17attachmentA.SecondaryAxis = Vector3.new(0, 0, 1)18attachmentA.Parent = BodyA1920local attachmentB = Instance.new("Attachment")21attachmentB.Position = Vector3.new(1, 0, 0)22attachmentB.Axis = Vector3.new(-1, 0, 0)23attachmentB.SecondaryAxis = Vector3.new(0, 1, 0)24attachmentB.Parent = BodyB2526local universalConstraint = Instance.new("UniversalConstraint")27universalConstraint.Attachment0 = attachmentA28universalConstraint.Attachment1 = attachmentB29universalConstraint.Parent = BodyA
This property, when enabled, limits the relative angular motion of the primary axes of attachments through a cone constraint. The default value is false.
The example below demonstrates how developers can enable a cone limit on the relative motion of the primary axes:
1universalConstraint.LimitsEnabled = true2
In order for this property to take affect, the constraint's UniversalConstraint.LimitsEnabled property must be set to true.
For example, the code snippet below sets LimitsEnabled to true and limits the UniversalConstraint.MaxAngle to 10 degrees:
1universalConstraint.LimitsEnabled = true2universalConstraint.MaxAngle = 103
This property determines the restitution of the two limits, or how elastic they are. The value defaults to 0 and can be any floating number in the range [0, 1].
1This property only applies when `Class.UniversalConstraint.LimitsEnabled` is set to true.2