UnitySpline2D icon indicating copy to clipboard operation
UnitySpline2D copied to clipboard

How to move my object based on the path?

Open b3da opened this issue 8 years ago • 3 comments

Would you please describe how to use this component. I have created a spline but I don't know how to move my object on this path.

b3da avatar May 28 '17 17:05 b3da

+1 currently trying to do that as well!

LauraWebdev avatar Nov 11 '17 23:11 LauraWebdev

Sorry, didn't see this until now! :o

Previously you could just pull out the values using spline.Interpolate or spline.InterpolateDistance. There are now 'world space' variants of these methods now too, spline.InterpolateWorldSpace, spline.InterpolateDistanceWorldSpace etc. Just pass either a parametric (0-1) for the former or a distance along the curve for the latter and plug that into a transform.position.

sinbad avatar Apr 17 '19 12:04 sinbad

how to use rotation?

vintil4 avatar Nov 28 '19 08:11 vintil4