Unity uses the Curvy Spline plug-in to generate curves and make objects move along the generated curves.

Plug-in download:

  1. Internet resources

  1. Assets Store

I'm using Curvy Splines - 7.1.4. After importing, the following interface will appear in the scene.

Create curve

https://blog.csdn.net/cordova/article/details/52215079

If the created curve is not displayed, click Gizmos in the upper right corner of the Scene.

If mesh is not required, the generated path is as shown in the figure

motion script

Attach the Spline Controller script to the object you want to move, select the Spline curve, and set the speed. The object can loop and play motion according to the set trajectory.

Use Curvy in Unity to quickly generate paths and make objects move along the route_Reliable Seventy-Six Blog-CSDN Blog

Guess you like

Origin blog.csdn.net/Suxiang1997/article/details/129714021