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
| Member | Description |
|---|---|
| Joint2D.Enabled | Whether this component is enabled. Use SetEnabled to change it. |
| Joint2D.Type | Revolute = hinge; Fixed = weld (arrow sticking); Distance = rope or spring. |
| Joint2D.MinimumAngle | Joint's minimum allowed angle in degrees. |
| Joint2D.MaximumAngle | Joint's maximum allowed angle in degrees. |
| Joint2D.MotorSpeed | Target angular velocity (rad/s). 0 with positive Motor Force brakes the hinge. Revolute only. |
| Joint2D.MotorForce | Max motor force. 0 = motor off. Revolute only. |
Methods
| Member | Description |
|---|---|
| Joint2D.SetEnabled | Enable or disable this component's behavior. |
| Joint2D.Break | Disable and release this joint. |
| Joint2D.SetLimits | Set the joint's minimum and maximum angles in degrees. |
| Joint2D.SetMotor | Set angular motor speed in radians per second and maximum motor force. |