- Home /
iTween... moving in a closed path, in loop, no delay
I am new to unity and to iTween. I am trying to make an object move in a path, in loop, with no delay.
Imagine the path as a circle and the object moves along this circle constantly with no delay, smoothly.
I created a path with 9 nodes. Each node is over a circle, every 45 degrees. The first node is at 0 degrees in the circle and the last one at 360 degrees, that is the same starting point. I was not sure if should have this 9th node or stop at the 8th node...
Then I added this line to the object
iTween.MoveTo(gameObject, iTween.Hash("path", iTweenPath.GetPath("zero"), "time", 5, "loopType", "loop", "orientToPath", true, "delay", 0));
I was expecting this to be smooth, but it runs the loop, waits about 2 seconds, runs it again, etc. and the movement is not linear it is more like accelerating at the start and breaking at the end.
Is there a way to create a perfect loop with any path using iTween?
In this case the path was a circle but I intend to use it on different paths, always closed ones.
thanks.
Where did you put the iTween.$$anonymous$$oveTo call, inside an Update(){} block? If so, it's being called every frame (probably more than 30+ times per second). It may also help to cache the result of iTweenPath.GetPath("zero"), so it doesn't need to do that lookup on each loop call.
Ah, I should have scrolled horizontally and read the whole line. Nah that looks solid, now I'm even curious as to why you're getting the delay.
Answer by SB2020 · Jan 24, 2014 at 01:46 PM
You need to add - "easetype", iTween.EaseType.linear to the Hash as without it iTween will default to easeOutExp.
Your answer
![](https://koobas.hobune.stream/wayback/20220613071121im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
iTween PutOnPath 1 Answer
triggering character bone anmimation from Itween 0 Answers
Null Ref Error with Playmaker and iTween 1 Answer
Rotation facing the right way problem 0 Answers