# Sandbox.Physics.PhysicsJoint.CreateBallSocket

## Overload 1

```csharp
static BallSocketJoint CreateBallSocket(PhysicsBody body1, PhysicsBody body2, Vector3 origin)
```

Creates a ball socket constraint.

### Parameters

- `body1` (`PhysicsBody`): The source physics body.
- `body2` (`PhysicsBody`): The target physics body to constrain to.
- `origin` (`Vector3`): The origin of the hinge in world coordinates. The 2 bodies will rotate around this point.

### Returns

`BallSocketJoint`: The created ball socket joint.

## Overload 2

```csharp
static BallSocketJoint CreateBallSocket(PhysicsPoint a, PhysicsPoint b)
```

Creates a ball socket constraint.

### Parameters

- `a` (`PhysicsPoint`): The source physics body.
- `b` (`PhysicsPoint`): The target physics body to constrain to.

### Returns

`BallSocketJoint`: The created ball socket joint.

Declared in [Sandbox.Physics.PhysicsJoint](/api/Sandbox.Physics.PhysicsJoint).
Assembly: `Sandbox.Engine`.
