Verlet Transforms

A MonoBehaviour component for simulating soft-body or chain-like animation behaviour using Verlet integration applied to multiple VerletTransformTree instances. Typically used to drive physics-like behaviours on bones, joints, or pseudo-rigid chains.

The VerletTransforms component acts as a controller that manages one or more VerletTransformTree objects. Each tree defines a hierarchy of nodes that simulate physics-based motion via Verlet integration. This component provides global controls for registering nodes and applying forces, and it draws gizmos for visual debugging in the editor.

Public Fields

Show Gizmo

If enabled, gizmos will be drawn in the Scene view to visualise the simulated hierarchies.

Transfrom Hierarchies

The list of managed transform trees. Each VerletTransformTree handles its own node hierarchy and settings.

Public Methods

Register Trees

Registers all nodes in the transformHierarchies. This is typically called once at startup, but can be called manually to refresh the node layout in-editor.


Add Force

Applies a global directional force to all transform trees.


Add Force At Position

Applies a radial force from a specific world position to all transform trees.


Add Force

Applies a force to a specific tree by index. If the index is invalid, a warning is logged.


Get Tree

Returns a tree from transformHierarchies at the given index. Logs a warning if the index is invalid.


Example Usage

Basic Setup

  1. Add VerletTransforms to a GameObject.

  2. Assign one or more VerletTransformTree instances in the inspector.

  3. Optionally, use the context menu "Register Nodes" to initialise the tree.

Applying Forces at Runtime

Generally input happens by moving the object or other objects moving into it (collision) however you can also inject force such as from an explosion or wind.

Last updated