user1021110
user1021110

Reputation: 213

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

Upvotes: 3

Views: 2794

Answers (2)

Richard Hawkes
Richard Hawkes

Reputation: 53

Not so much an answer, but more of a comment on my research into this issue. It seems the PixelPlacement guy has been promising a fix for at least 3 years now, but nothing is forthcoming. People are having to work around it. I found a reasonable example here.

Annoying. But it is free. Although I did pay for the examples, which is ultimately very cheap, but still a little frustrating as I'd hoped this would be addressed given the amount of chatter on the internet about it!

Upvotes: 0

Rune Vejen Petersen
Rune Vejen Petersen

Reputation: 3239

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

Upvotes: 2

Related Questions