iTween and orientToPath issue.

I am beginner level Unity3D user. I’ve just recently seen iTween. It provides a rich and usefull set of tools.

I am trying to move an airplane along a path generated using iTween path editor. Following is the code attached to the airplane object.

using UnityEngine;
using System.Collections;

public class CircuitFlight : MonoBehaviour {

	// Use this for initialization
	void Start () {
		iTween.MoveTo(gameObject, iTween.Hash("path", iTweenPath.GetPath("FlightPath01"), "time",10, "islocal",true, "orientToPath",true));
	} 
}

Airplane object follows the path. But, it doesn’t correctly orient itself to the path. The airplane object has a hierarch, (empty game obj, fuselage and propeller). I’ve also tested the same code on an ordinary cube. Result is the same; i.e. I could not get “orinetToPath” to work.

Can someone advise me how to move an object over a path and orient its motion to the path?

-Kaya

Try adding a “lookTime” property around of around .2. Hope that helps.

Thank you “pixelplacement1”; iTween is an excellent tool set that everybody must have.
Adding "adding a “lookTime” property around of around .2. " as you suggested helped (altough in my application “orientToPath” still seems to be not perfect). It seems to be that the relative locations of the of the path nodes make big difference.

using UnityEngine;
using System.Collections;

public class CircuitFlight : MonoBehaviour {

	// Use this for initialization
	void Start () {
		iTween.MoveTo(gameObject, iTween.Hash("path", iTweenPath.GetPath("FlightPath01"), "time",30, "islocal",true, "orientToPath",true, "lookTime", 0.2));
	} 
	
}

I wish iTween path editor would allow us to play with more than 10 nodes. And it would also allow us to delete a selected node (not only deleting the last node) and insert (not append) a node to a position pointed by the mouse.

I Lv iTween!

-Kaya

From all of my testing I’ve known the “orientToPath” to be pretty accurate. You can adjust it even more with the look ahead amount variable.

You can easily increase the 10 point limit of the path editor. Re-read the blog entry (http://pixelplacement.com/2010/12/03/visual-editor-for-itween-motion-paths/) to learn how to.

Thank you pixelplacement1.

hi pixelplacement1,

I have a question that is related, maybe it should be handled in its thread here:
http://forum.unity3d.com/threads/82391-airplane-path-simulation?highlight=airplane+path

Is there a way to achieve that with iTween?

I want to simulate an airplane movement without looking too fake. Airplanes don’t go from point A to B, but they roll and pitch to arrive to that point based on where they are headed at the moment.

Hi,
First of all, awsome tool iTween, thanks for making it!

I’m having some issues with the orientToPath. The orientation is way off. It seems like it rotating too early, or just skipping rotation on some parts. Even when adding the lookTime part in there it seems to make no difference no matter what value i use. Here is my code for it.

iTween.MoveTo(gameObject, iTween.Hash(“path”, iTweenPath.GetPath(“path1”), “axis”, “y”, “orienttopath”, true, “lookTime”, 0.2, “speed”, 2.6, “easetype”, iTween.EaseType.linear));

Any ideas?

EDIT Found the lookahead variable and set that to 0.001. Solved the issue for me. Don’t know if this has any performance effects, but looks good.

Hey, I’m having some problems with orienttoPath. I"m doing this:

iTween.MoveAdd (gameObject,
iTween.Hash (“name”, “zombieMovement”,“space”, Space.Self , “amount”, movementOffset , “time”,time, “looptype”, loop, “easetype”, iTween.EaseType.linear ));

And this works fine, the object moves up and down it’s path. But when I add “orienttopath”, true, the character essentially freezes, with minor movement in the z axis. I’ve added looktime but that doesn’t seem to resolve the issues. Any ideas why?
THanks
Thanks!

I have a similar issue to Ant. There’s about a 4.5 second delay until the object actually starts moving along the path.

Just wondering where the changing of the limit of 10 is on your blog? I have looked over and searched keywords for the limit to be higher as well and I see nothing that indicates how to up the limit of points on the path?

Is that all that’s involved is changing:
_target.nodeCount = Mathf.Clamp(EditorGUILayout.IntSlider(_target.nodeCount, 0, 10), 2,100);

where 10 would be the max limit?

perfect pixelplacement…

thank you very much ,i have the same issues.i also set lookahead to 0.001 ,it works!!!