Connect Banter Physics Objects with Joints

Banter joint components constrain physics objects in different ways. Fixed joints lock objects together, hinge joints rotate around one axis, spring joints create an elastic connection, character joints add swing and twist limits, and configurable joints expose per-axis control.

Joint Setup Order

Create both physics objects and their rigidbodies first, then add the joint with the connected rigidbody ID and the required anchors or limits.

  1. Add colliders and BanterRigidbody to the connected objects.
  2. Keep the returned rigidbody reference for the object the joint connects to.
  3. Add the joint and set connectedBody to that rigidbody's ID.

The Important connectedBody Rule

The official Banter reference states that connectedBody is the id of the rigidbody component on the other GameObject.

If a hinge joint has no connected body, it connects to world space instead.

const frameBody = frame.AddComponent(
  new BS.BanterRigidbody({
    isKinematic: true
  })
);

const doorBody = door.AddComponent(
  new BS.BanterRigidbody({
    mass: 2,
    useGravity: true
  })
);

The joint placed on the door should use frameBody.id when it must connect to the frame.

Create a Hinge Joint

door.AddComponent(new BS.HingeJoint({
  anchor: new BS.Vector3(-0.5, 0, 0),
  axis: new BS.Vector3(0, 1, 0),
  autoConfigureConnectedAnchor: true,
  useLimits: true,
  limits: new BS.JointLimits({
    min: 0,
    max: 110,
    bounciness: 0,
    bounceMinVelocity: 0,
    contactDistance: 0
  }),
  useMotor: false,
  useSpring: false,
  enableCollision: false,
  connectedBody: frameBody.id
}));

The axis controls the direction of rotation. Limits constrain the permitted angle.

Fixed Joint

FixedJoint locks two objects together. Its documented options include anchors, automatic connected-anchor configuration, break force, break torque, collision between the connected bodies, and the connected body ID.

Use it when two separately simulated objects should behave as one connection until the joint breaks or is removed.

Spring Joint

SpringJoint creates an elastic connection. Its settings include:

  • spring force
  • damping
  • minimum and maximum distance
  • tolerance
  • anchors
  • break force and torque
  • connected body

Use damping to reduce continued oscillation when the design should settle.

Character Joint

CharacterJoint provides swing and twist limits with an axis and swing axis. It is intended for human-like constrained motion rather than a simple one-axis hinge.

Configurable Joint

ConfigurableJoint exposes linear and angular motion separately for each axis. Each motion can use Free, Limited, or Locked through BS.ConfigurableJointMotion.

The component also supports target position, rotation, velocity, angular velocity, primary and secondary axes, connected anchors, world-space configuration, and swapped bodies.

Use a configurable joint when the simpler joint types cannot describe the required constraint.

Anchors and Collision

anchor is the joint location on the current object. connectedAnchor is the matching location on the connected body. autoConfigureConnectedAnchor lets the engine calculate the connected value.

enableCollision controls whether the connected objects can collide with one another.

Common Questions

Why does my Banter hinge connect to the world instead of another object?

Set connectedBody to the ID of the BanterRigidbody component on the other GameObject.

Why does my door rotate around the wrong line?

Check the hinge anchor, axis, connected anchor, and the transforms of both GameObjects.

Official References

Related Navigation