docs.unity3d.com
    Show / Hide Table of Contents

    Create a tube-shaped mesh along a spline

    Use the Spline Extrude component to extrude a mesh along a spline to create shapes such as tubes, wires, ropes, and noodles.

    To create a tube-shaped mesh along a spline:

    1. Do one of the following to create a spline:
      • Go to GameObject > Spline > Draw Splines Tool.
      • In the Hierarchy window, right-click and select Spline > Draw Splines Tool.
    2. Draw a shape for the spline:

      • Click in the Scene view to create knots for the spline's path to follow.
      • To add a curve to a knot's segment, click and drag to create a knot with tangents.
      • To exit the Draw Splines Tool, select a tool in the Tools overlay or press Escape.

        Tip

        You can quickly manipulate the position of knots and tangents. In the Tools overlay, set the tool context to Spline and make sure that Draw Splines Tool is disabled. Select and drag a knot or tangent to move it.

    3. Add the Spline Extrude component to the GameObject that has the spline you created attached to it.

    4. In the Spline Extrude component, do the following to configure the extruded mesh:
      • Enter a value for the Radius property to set the thickness of the extruded mesh. A higher value creates a thicker mesh and lower value creates a thinner mesh.
      • Enter a value for the Profile Edges property to select how many sides the radius of the mesh has.
      • Enter a value for the Segments Per Unit property. If your spline has lot of curves, enter a high value to make the extruded mesh look smoother.
      • If your spline isn't closed and you want to fill in the ends of your extruded mesh, enable Cap Ends.

    Additional resources

    • Create a spline
    • Spline Extrude component reference
    • Use components
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023