DOLocalPath Method
DOLocalPath(Rigidbody, Vector3[], float, PathType, PathMode, int, Color?)
public static TweenerCore<Vector3, Path, PathOptions> DOLocalPath(this Rigidbody target, Vector3[] path, float duration, PathType pathType = null, PathMode pathMode = null, int resolution = 10, Color? gizmoColor = null)
Tweens a Rigidbody's localPosition through the given path waypoints, using the chosen path algorithm. Also stores the Rigidbody as the tween's target so it can be used for filtered operations
NOTE: to tween a rigidbody correctly it should be set to kinematic at least while being tweened.
BEWARE: doesn't work on Windows Phone store (waiting for Unity to fix their own bug). If you plan to publish there you should use a regular transform.DOLocalPath.
Parameters
targetRigidbodypathVector3[]The waypoint to go through
durationfloatThe duration of the tween
pathTypePathTypeThe type of path: Linear (straight path), CatmullRom (curved CatmullRom path) or CubicBezier (curved with control points)
pathModePathModeThe path mode: 3D, side-scroller 2D, top-down 2D
resolutionintThe resolution of the path: higher resolutions make for more detailed curved paths but are more expensive. Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints
gizmoColorColor?The color of the path (shown when gizmos are active in the Play panel and the tween is running)
Returns
- TweenerCore<Vector3, Path, PathOptions>