Skip to content

samlletas/verlet-chain-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Verlet Chain System

Rope/Chain simulation system, ideal for character clothes such as scarves and capes.

Screenshot

Features

  1. Simulation runs at a fixed timestep for consistency (framerate is user-configurable).
  2. Optional interpolation toggle for smooth animations.
  3. Cloth flowing on wind effect (useful for idle characters).
  4. Override system to change parameters on the fly for finer control of animations (e.g. decreasing simulation gravity during a character jump).

Demo

A demo of the example scene can be downloaded from: demo-windows.zip

Controls:

  • Drag the yellow knob with the mouse.

Setup

Download or clone the source code and copy/paste the VerletChainSystem folder into your Assets folder.

Usage

  1. Add the VerletChain component to an empty gameobject, this will add a LineRenderer component (don't forget to set the color, width and material).

  2. (Optional) Add the VerletWave component to get a wind-like effect on your rope/chain.

  3. (Optional) Create overrides by right clicking on the project view and selecting Create -> Verlet Chain System -> Verlet Chain Override. To apply an override simply call the VerletChainOverride.Apply function and pass the reference to the chain that you wish to have it's parameters changed:

    myOverride.Apply(myChain);

References

About

Rope/Chain simulation system (Unity Engine).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published