Description
Unity Bezier Curve & Squad Movement Tool
A robust, modular, and professional path-following solution for Unity 2022 LTS. Create complex C1-continuous spline paths directly in the editor and drive individual units or organized squads with ease.
Compatible with: Unity 2022.3 LTS+ (Built-in, URP, HDRP)
✨ Features
🛠️ Visual Spline Editor
- WYSIWYG Editing: Edit curves directly in the Scene View with interactive handles.
Show full description...
- Multi-Segment Splines: Easily extend your path by clicking "Add Segment".
- Undo/Redo Support: Full Unity Editor integration.
- Gizmo Visualization: See your path, control points, and tangents clearly.
🏃 Advanced Movement Logic
- Constant Speed (Arc-Length Parametrization): Solves the common Bezier problem where objects speed up/slow down on curves. Units travel at a consistent real-world speed (meters/sec).
- Smooth Rotation: Objects naturally rotate to face their path with configurable damping (Slerp) to avoid jitter on sharp corners.
- Extrapolation: Logic handles off-path states gracefully, ensuring units maintain formation even when entering/exiting the path.
🛡️ Squad & Formation System
Built-in
CurveGroup controller to manage multiple units as a single entity.
- Single File (Snake Mode):
- Units follow one another with strict spacing.
- "Train" Behavior: Units queue up visibly at the start and end using seamless tangent extrapolation. No stacking or popping!
- Side-By-Side (Wall Mode):
- Moves units in a horizontal line formation.
- Formation Smoothing: Dampens lateral movement on sharp zig-zag turns to prevent outer units from "whipping" too fast.
- Ping-Pong & Loop: Full support for looping paths or patrolling back and forth.
📦 Installation
- Download the package/source.
- Drop the Scripts and Editor folders into your Unity project Assets/.
- That's it! No dependencies required.
🚀 Quick Start
1. Create a Path
- Create a new Empty GameObject.
- Add the BezierPath component.
- Use the Scene View handles to shape your curve. click Add Segment in the Inspector to extend it.
2. Move an Object
- Add CurveFollower to your player/object.
- Assign the Path.
- Hit Play!
3. Move a Squad
- Create an Empty GameObject (the Controller).
- Add CurveGroup.
- Drag your Unit Transforms into the Units list.
- Choose Single File or Side By Side.
- Adjust Spacing and Speed.