A chain is moving components along a spline path. This is useful for modeling for example for material handling or tool changers which are driven by chains.
You can find at Assets/game4automation/Scenes/DemoChain a demo scene for the Chain.
A chain is always connected to a drive. Thus, the movement of the chain always depends on the current drive position and speed. Usually, you should use a Drive in which the Axis is set to Virtual to move the chain.
To the chain one or several Chain elements are connected. These Chain elements are created automatically pon simulation start by the chain. Usually, these chain elements should be Prefabs inside your project.
On the same component where the Chain script is attached to, a Spline script needs to be attached. The spline script is defining the exact path of the chain based on points within and out tangents.
For extending a spline or for creating a first point you can push on the Extent button on the Spline. This will generate a Point with 2 included Tangent points. You can move these points like you can move any Gameobject to construct your spline. The order of these Gameobjects defines also the order of the points in the spline. If you select Loop the spline is closed and the last point is connected to the first point of the spline.
With Chain Element the prefab of the chain elements which should be placed along the spline needs to be assigned to the chain. The Connected Drive is moving the chain. The Number of Elements defines the number of elements that should be created upon simulation start on the chain. The start position is an offset in relation to the spline start. By selecting Calculate Delta Position the distance between the chain elements is calculated automatically based on the spline length and the number of elements.