Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Constant speed issue in defining iTween path

I've designed a curved path like the below figure. enter image description here

The cube move along the path from the left side to the right side of scene by this line of code:

iTween.MoveTo(gameObject,iTween.Hash("oncomplete","destroying","orienttopath", true, "path",path,"time",1.6,"easetype",iTween.EaseType.linear,"movetopath",false));

the EaseType parameter is was selected linear and I expect to path the path with a constant velocity, however the speed is reduced when the cube is in the curved path (left side before the midpoint) and then in a straight path it accelerates and catches it up.

I would like to know how can I define a constant speed for entire path.

Thanks

like image 248
user1021110 Avatar asked Feb 17 '26 16:02

user1021110


1 Answers

iTween will take the same time going from node 1 to node 2 as it will going from node 2 to node 3. Since your first 2 nodes are close together it will go slowly here and speed up towards the third.

If you get a more uniform distance between your nodes you'll experience a smoother path using linear easetype

like image 98
Rune Vejen Petersen Avatar answered Feb 20 '26 06:02

Rune Vejen Petersen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!