dotween icon indicating copy to clipboard operation
dotween copied to clipboard

PathType.CubicBezier does not create curves in 2D mode

Open emredesu opened this issue 1 year ago • 0 comments

A path tween started with using

 Vector3[] cubicBezierPath = new Vector3[] { waypoint0, transform.position, waypoint0, waypoint1, waypoint0, waypoint1, waypoint2, waypoint1, waypoint2 };
movementTween = transform.DOPath(cubicBezierPath, moveSpeed, PathType.CubicBezier, PathMode.Sidescroller2D, 20, Color.red).OnComplete(() => StartMoveTween()).SetSpeedBased(true).SetEase(Ease.OutQuad).SetUpdate(UpdateType.Fixed);

generates the following curvature (or the lack thereof - indicated with the red lines): image

And this is how the same generated curvature looks using

Vector3[] cubicBezierPath = new Vector3[] { waypoint0, waypoint1, waypoint2, waypoint3 };
movementTween = transform.DOPath(cubicBezierPath, moveSpeed, PathType.CatmullRom, PathMode.Sidescroller2D, 20, Color.red).OnComplete(() => StartMoveTween()).SetSpeedBased(true).SetEase(Ease.OutQuad).SetUpdate(UpdateType.Fixed);

looks:

image

emredesu avatar Jun 02 '23 18:06 emredesu