dotween
dotween copied to clipboard
PathType.CubicBezier does not create curves in 2D mode
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):
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: