- Home /
iTween : Move Just a Small Portion of a Path?
Hello, I just purchased the iTween "Using PutOnPath and PointOnPath" example! I plan on purchasing more examples as they become relevant. Someone can point me in the general direction please!
My entire game takes place on a platform. Performing tasks on the platform moves the platform upwards. I would like to change this to iTween, and make it so that performing tasks moves the platform a PORTION of the way along a loooooong path (that is a loop)!
So: What is the best way to smoothly move an object for 2 seconds (at a fixed speed) along an endless (looping) path and then smoothly stop it wherever it happens to be?
(should I use putonpath? pointonpath? waypoints? visual editor with some fancy javascript? "Path-constrained Characters"? etc.)
THANKS!
p.s. I figured out how to do this without iTween by creating an animation and playing it for a few seconds, but iTween looks like a powerful way to make much more elegant curves!
Answer by Wesww · Jun 06, 2012 at 07:52 PM
The answer was that it indeed was NOT possible. iTween moves things from one node to another node, and isn't intended to stop things in between nodes.
Answer by ben · Mar 23, 2011 at 02:48 PM
drag ur iTweenPath script to camera or an empty game object and set the nodes u needed.....if u need more number of nodes edit in iTweenPathEditor 73rd line from _target.nodeCount = Mathf.Clamp(EditorGUILayout.IntSlider(_target.nodeCount, 0, 10), 2,100); to _target.nodeCount = Mathf.Clamp(EditorGUILayout.IntSlider(_target.nodeCount, 0, 30(can set any no. of nodes)), 2,100); drag the nodes which we have in scene view and create ur own path........give a path name too.....default name is New Path1.....
then write a c# program(iTween Path editor is in c sharp thats y..... if u have it in .js create a .js program) as,
void Start () { iTween.MoveTo(gameObject, iTween.Hash("path" , iTweenPath.GetPath("CamPathForward"), "time" , 10, "easeType", iTween.EaseType.easeInOutSine, "isLocal", true)); }
place the script in the object u wanna move.......
if u place this script other than the object u wanna move declare a game object at first and drag it in inspector, then change gameObject - name of ur game Object CamPathForward - name of the path i have created
if u wanna move the object for a small portion of the path (means till a particular node)get the particular node as it destination or place reduce the path length
Thanks for replying! Does that mean it is not possible to stop in between two nodes? For what I am attempting, from what you have said, I would have to create each node individually and I would have thousands of nodes (or millions even), all precisely the exact same distance apart, to create draw my path.
Obviously that would not be ideal. If there is a way to stop between nodes then I could put the nodes where I want the path to curve only, and move my object just the distance I want each time.
If I cannot stop in between nodes I will go back to creating a long animation (probably in $$anonymous$$aya) and animating a set number of frames, I just thought iTween would be better!
Perhaps this might somehow be possible with Pause(GameObject target)?
Your answer
Follow this Question
Related Questions
iTween Put On Path percentage 0 Answers
iTween Help Please MoveTo not working 1 Answer
iTween - Traveling around a cylinder 2 Answers