A simple script that extrudes a mesh along a Spline in Unity
For a deeper explanation of how this script works, see my Medium Article.
You can simply download the two .cs
files into your Unity Project.
The included scripts use Unity's new Splines
package (UnityEngine.Splines
).
To extrude a mesh along a spline, follow these steps:
SplineMeshExtrude
script to a gameobject that also contains a Spline.extrusion template mesh
field.extrusion axis
field. (only tested using Z axis)smooth faces
box. For flat shading, uncheck the box.use world up
box. To allow 'twisting' around the spline, uncheck the box.Enjoy!