Reference API Roblox

Engine API

Website

Related

Reference API Roblox

BallSocketConstraint

Forces its two attachments into the same position and allows them to freely rotate about all three axes, with optional limits to restrict both tilt and twist.

Member index 9

HistoryMember
553LimitsEnabled: bool
553MaxFrictionTorque: float
553Radius: float
553Restitution: float
553TwistLimitsEnabled: bool
553TwistLowerAngle: float
553TwistUpperAngle: float
553UpperAngle: float
inherited from Constraint
553Active: bool
553Attachment0: Attachment
553Attachment1: Attachment
553Color: BrickColor
553Enabled: bool
553Visible: bool
604GetDebugAppliedForce(bodyId: int): Vector3
604GetDebugAppliedTorque(bodyId: int): Vector3
inherited from Instance
553Archivable: bool
635Capabilities: SecurityCapabilities
553Name: string
553Parent: Instance
635Sandboxed: bool
616UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
486GetDescendants(): Array
486GetFullName(): string
641GetStyled(name: string): Variant
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
580IsPropertyModified(name: string): bool
573Remove(): null
576RemoveTag(tag: string): null
580ResetPropertyToDefault(name: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
648children(): Instances
553clone(): Instance
573destroy(): null
553findFirstChild(name: string, recursive: bool = false): Instance
648getChildren(): Instances
553isDescendantOf(ancestor: Instance): bool
573remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
553childAdded(child: Instance)
inherited from Object
647ClassName: string
647className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
650isA(className: string): bool
647Changed(property: string)

Description

A BallSocketConstraint constrains its Attachments so that they occupy the same position. By default it allows both attachments to freely rotate about all of their axes, but if LimitsEnabled is true, the attachments can only rotate in a limited cone.

Note that if this constraint attaches one part (A) to another part (B) that is anchored or connected to an anchored part (Z), part A will not be locally simulated when interacting with a player.

When configuring this constraint, it may be helpful to study Roblox Units to understand how Roblox units compare to metric units.

Limits

You can set limits to restrict both tilt and twist of a ball socket, similar to how a human's head can tilt and turn within a limited axial range. Enabling the LimitsEnabled property exposes the UpperAngle value to restrict tilt within a cone; it also exposes the TwistLimitsEnabled property which, when enabled, lets you restrict twist rotation through the TwistLowerAngle and TwistUpperAngle limits.

History 41

Members 9

LimitsEnabled

TypeDefault
boolfalse

Sets whether the BallSocketConstraint has a limit on rotation based on UpperAngle. When true, it enforces that its Attachment1 isn't rotated more than a set angle from its Attachment0.

History 4

MaxFrictionTorque

TypeDefault
float0

Sets the maximum frictional torque applied to keep its Attachments aligned.

MaxFrictionTorque specifies the stiffness of the BallSocketConstraint (how much it resists rotation around its Attachments).

History 8

Radius

TypeDefault
float0.150000006

The visualized radius of the BallSocketConstraint.

History 4

Restitution

TypeDefault
float0

How elastic Attachments connected by a BallSocketConstraint will be when they reach the end of the range specified by UpperAngle when LimitsEnabled is true. Constrained between 0 and 1.

History 4

TwistLimitsEnabled

TypeDefault
boolfalse

Sets whether the BallSocketConstraint sets a limit on twist rotation based on TwistUpperAngle and TwistLowerAngle. The twist angle is defined as the angle between the Y axis of Attachment1 and the Y axis of Attachment0.

History 4

TwistLowerAngle

TypeDefault
float-45

Sets the lower twist rotation limit of the BallSocketConstraint, as long as TwistLimitsEnabled is true.

History 4

TwistUpperAngle

TypeDefault
float45

Sets the upper twist rotation limit of the BallSocketConstraint, as long as TwistLimitsEnabled is true.

History 4

UpperAngle

TypeDefault
float45

Sets the upper rotation limit of the BallSocketConstraint, as long as LimitsEnabled is true.

History 4

Settings