Skip to content

Joint2D ​

class in OpalScript

Connects this object's rigid body to another with a hinge, weld, or distance joint. Both objects need Rigid Body 2D (and usually Collider 2D).

Properties ​

MemberDescription
Joint2D.EnabledWhether this component is enabled. Use SetEnabled to change it.
Joint2D.TypeRevolute = hinge; Fixed = weld (arrow sticking); Distance = rope or spring.
Joint2D.MinimumAngleJoint's minimum allowed angle in degrees.
Joint2D.MaximumAngleJoint's maximum allowed angle in degrees.
Joint2D.MotorSpeedTarget angular velocity (rad/s). 0 with positive Motor Force brakes the hinge. Revolute only.
Joint2D.MotorForceMax motor force. 0 = motor off. Revolute only.

Methods ​

MemberDescription
Joint2D.SetEnabledEnable or disable this component's behavior.
Joint2D.BreakDisable and release this joint.
Joint2D.SetLimitsSet the joint's minimum and maximum angles in degrees.
Joint2D.SetMotorSet angular motor speed in radians per second and maximum motor force.

See also ​