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 :
Then, it gets here :
I would expect to have something like :
The spaceship is just a plane with a texture using transparent shader attached to it.
Any help would be greatly appreciated
Thanks
Florent