Unity package for simplified representation of the flexible cable chain.
Insert package using the Unity Package Manager or directly in Packages/manifest.json
.
{
"dependencies": {
"com.preliy.chain": "https://github.com/Preliy/Chain.git#upm",
"com.unity.render-pipelines.universal": "14.0.11"
}
}
Note
Universal Render Pipeline is used.
Add Chain.cs
component to GameObject.
- Add Prefabs to the
Prefabs
List and define theItem Offset
. The Prefabs are instantiated one after the other with the offset along the spline. - Define the
Length
andRadius
for the spline. - Use
Gizmos
parameter to display the gizmos and see current spline Use Main Root
reparent while starting the chain items to the main root of the scene. You can use it to gain performance for large chains.
Note
The parameterization and item instantiation happens along local Forward direction (Vector3.Forward).
The position change for chain is possible with direct manipulation with Position
property or by assigning the Follow Target
.