I have a question about DoPath's speeds between waypoints. I want constant speed from start to end but i couldn't achieve that. But speed changing between waypoints.
I couln't find solution for my problem.
Vector3 firstPoint = from+new Vector3(5f,5f,0);
pathList.Add(from);
pathList.Add(firstPoint);
pathList.Add(to);
Vector3[] pathArr = pathList.ToArray();
GameObject trail = Instantiate(config.fireWork, from, Quaternion.identity);
trail.transform.DOPath(pathArr,3,PathType.CatmullRom,PathMode.TopDown2D).SetEase(Ease.Linear).SetLookAt(0.01f).SetDelay(1f);
https://gfycat.com/highunknowngentoopenguin
I want constant speed from start to end.
Looks like it only takes in the duration of the tween.
You may have to use the generic way: DOTween.To(...).
Get the distance between the current points and divide it by your movement speed.
If you put .SetSpeedBased(true) the duration will represent the number of units the tween moves x second.
P.S.
You can also set .SetLoops(-1) execution will loop on path.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With