S&box Wiki

Joints

This page is a work-in-progress. It requires more sections, fact checking and screenshots.

Overview

A PhysicsJoint constrains the motion of one PhysicsBody with respect to another. When a PhysicsBody is dynamic, joints attached to the body may influence its movement.

Take for example two cubes connected by a SpringJoint. Each cube has a BoxCollider Component that defines its shape in the PhysicsWorld, as well as a Rigidbody Component that provides a dynamic PhysicsBody for the Collider to attach to.

TODO: Add a screenshot of the components.

Pulling the first cube causes the second to trail behind, and vice versa.

TODO: Add a diagram of a cube being pulled.

When a body is static or keyframed, joints will have no effect on the motion of that body, but a dynamic body attached to the other end of the same joint may be affected.

TODO: Add a diagram of a dynamic cube dangling from a static collider.

Joint Components

In the scene editor, PhysicsJoints may be created by adding to a GameObject one of several different Joint Components, each of which will be described below in further detail.

TODO: Fill out sections for each type of PhysicsJoint.

Fixed Joint

Spring Joint

Slider Joint

Hinge Joint

Ball Joint