Verlet Motion Toolkit

Verlet Motion Toolkit adds Verlet-integrated motion to Unity in two forms: jiggle for any Transform hierarchy, and a simulated rope with a generated mesh. It is a Toolkit package with no separate Foundation, com.heathen.verlet, for Unity 6000.0 and later, and it is Burst accelerated. DOTS projects can add the optional Entities layer for jiggle chains.

What is in the package #

  • Jiggle Transforms: VerletTransforms and VerletTransforms2D for hair, tails, capes, antennae, foliage, chains and bones. A fixed-step, substepped simulation with mass, spring stiffness, contact, teleport and pre-warm, in 3D and 2D, plus an Entities layer.
  • Ropes: VerletLine, a simulated rope or cable with a generated mesh, pins that can carry rigidbodies, collision, breaking and snapping.
  • Upgrading from 5.x: what changed in 6.0 and how to move over.

Requirements and install #

  • Unity 6000.0 or later.
  • Game Framework 1.4.0 or later, which Heathen Toolbox installs for you. It provides System Log.
  • Burst and Mathematics, resolved automatically as package dependencies.
  • Entities 1.0.0 or later, only if you want the Entities layer. It compiles in automatically when Entities is installed.

Install through the Heathen Toolbox, through the Unity Package Manager using the git URL, or from the Unity Asset Store. Verlet Motion Toolkit is standalone: it does not depend on Toolkit for Unity Physics or any other Heathen Toolkit.

What’s New in 6.0 #

Verlet Motion Toolkit 6.0 is a breaking release. If you are upgrading from 5.x, read Upgrading from 5.x first.

New #

  • A fixed game-time clock for jiggle chains with substeps, mass, real-unit spring stiffness and contact solved inside the step. The motion is the same at any frame rate, and frame spikes no longer shake the chains.
  • Pre-warm, so chains and ropes settle before the first frame, and Teleport() for instant moves.
  • A Burst rope kernel and a shared Burst mesh system, so ropes no longer use a thread each. Ropes have pin modes, can carry rigidbodies, and have a stretchCompliance setting.
  • Collision on every rope point, with ropes ignoring the colliders of their own pins and an ignore list.
  • An Entities layer for jiggle chains.
  • One shared simulation for 2D and 3D jiggle trees, a 2D example scene and a rope bridge sample.
  • Log output through System Log under Verlet.Transforms and Verlet.Line.
  • XML documentation on every public type and member, and tests.

Changed #

  • The package is standalone, needs Game Framework 1.4.0 or later and Burst, and no longer depends on Toolkit for Unity Physics.
  • Jiggle settings were rewritten: elasticity is a stiffness in newtons per metre, there is a mass curve, damping is per sixtieth of a second and maxSpeed is metres per second. Retune settings from 5.x.
  • Rope damping is quadratic drag, and substeps and iterations replace constraintIterations.
  • AddForceAtPosition pushes away from the point and fades to the radius.
  • Rope control points follow the object’s rotation and scale, and ropes ignore trigger colliders.
  • VerletTransformNode2D and VerletLineCollisionSegment are removed.

Fixed #

  • A one-pin rope hanging at full length, stretchiness doing nothing, NaN after pausing with a time scale of zero, the 2D angle limit for a straight-down chain, NaN for a bone on its parent, a collider created at the world origin, AddPin before Start, unbounded rope length, gizmo cost and bone data saved into scenes.

Samples #

Import the Example Scenes sample from the Package Manager. It lands in Assets/Samples/Verlet Motion Toolkit/6.0.0/Example Scenes and contains four scenes: the Demo Scene (hair, grass and links on many bones), the Rope Example (a rope bridge with pins, collision and rain of weights), the Skinned Mesh Sample (jiggle on a skinned character) and the 2D Example (two chains in 2D, one swinging into a 2D collider). They work with the Input System package or the legacy Input Manager.

System Log #

Verlet Motion Toolkit logs through Game Framework System Log under Verlet.Transforms and Verlet.Line, gated by Heathen.LogGates.Verlet.Transforms and Heathen.LogGates.Verlet.Line. Configure them in Project Settings, Subsystems, System Log. Only warnings are logged: a tree index out of range, a rope with fewer than two control points or no length, and a rope cut short at its point limit.

Related packages #

Rate This Article!