lovr.physics.newBallJoint

Creates a new BallJoint.

ball = lovr.physics.newBallJoint(colliderA, colliderB, x, y, z)

Arguments

NameTypeDescription
colliderACollider The first collider to attach the Joint to.
colliderBCollider The second collider to attach the Joint to.
xnumber The x position of the joint anchor point, in world coordinates.
ynumber The y position of the joint anchor point, in world coordinates.
znumber The z position of the joint anchor point, in world coordinates.

Returns

NameTypeDescription
ballBallJoint The new BallJoint.

Notes

A ball joint is like a ball and socket between the two colliders. It tries to keep the distance between the colliders and the anchor position the same, but does not constrain the angle between them.

See also