[SCREENSHOTS] itween Path, orientToPath and gameObject rotation, 2D game

Hello community

I have a plane, and a texture attached to it ( Spaceship ). This spaceship has a “direction”.
I have built a path, via Itween Path through the Editor and applied Itween.MoveTo function at Start() :

void Start() {
 iTween.MoveTo(gameObject, iTween.Hash("path", iTweenPath.GetPath("spaceshipPath"), "axis", "z", "time", 20, "orienttopath", true)); 

}

My spaceship follow the path properly. However, I thought that with orienttopath=true parameter, it would rotate automatically according to the curve, but it does not rotate at all.

I have tried to set the axis to x or y, but i have a weird behavior, rotating the spaceship to any direction.

In my point of view, the rotation axis should be ‘x’ though.
I have also played with looktime and lookahead parameter, but no luck.

Do you think it is feasible to achieve what i want using only itween.MoveTo in the Start() ?

I guess it would be possible to play around Itween.MoveUpdate + LookAtTarget in the Update() function. LookAtTarget would be the direction vector, calculated in the FixedUpdate() ( target = new position - old position ) but not sure either.

Spaceship starts from here :
alt text

Then, it gets here :
alt text

I would expect to have something like :
alt text

The spaceship is just a plane with a texture using transparent shader attached to it.

Any help would be greatly appreciated

Thanks

Florent

Ok, got this.
What you will have to do is 3 things:

1- Remove the Hash item “axis”,“z”.

2 - Create an empty Game Object and rotate him, so his Axis Z, will be the front of the space ship. As an example, I created a plane with an arrow texture. For it to become with the arrow up, I needed to rotate it 90 in X, and 180 in Y. The empty Game Object I rotate it to 270 in X and 270 in Y. S o the blue arrow(Z axis) of the empty Game Object faced the same direction of my plane arrow.

3- Put your space ship as a child of this empty Game Object. And put the spaceship position on 0,0,0 after. So the center of the spaceship will become the position of his parent, the empty Game Object.

Take care!

You should try to put your space ship inside a empty game object with it’s Z axis facing towards were you want to go(in that case, right). Then you use iTween path on the new object.

Let me know if it works.

Hello there.
I’m having the same problem as the above, but I’m using a 3D object (a cube to represent a mine-cart) and I want it to follow the train tracks path (drawn out using the iTween path system.

The problem is that the cart doesn’t rotate (I think the rotation has to be on the Y axis for me since it’s in 1st person view).
Though I’m not sure how to go about coding that or setting it up.
I read the answer above, I already had an empty game object, and the Z Axis (blue arrow) is pointing towards the “face/front” of the cart. It’s still not working, and the cart doesn’t rotate at all. It just moves along the path (in a funky unstable way if I may add).

Thanks.