Hello everyone.
I’m using iTween’s MoveTo to move my gameobject along a path and everything works fine.
My problem is, the rotation of the gameobject stays the same while he is moving along the path.
I want him to rotate in the direction of the path.
This is my line of code:
iTween.MoveTo(gameobject, iTween.Hash("path", iTweenPath.GetPath("ConvoyPath"), "orienttopath", true, "looktime", 0.01f, "time", 500));
Thanks!
I’ve also posted this on unity answers here:
itween-moveto-rotation
Please help, really clueless about this…
The iTween Help helps out:
orienttopath boolean for whether or not the GameObject will orient to its direction of travel. False by default
looktarget Transform or Vector3 for a target the GameObject will look at
looktime float or double for the time in seconds the object will take to look at either the "looktarget" or "orienttopath"
lookahead float or double for how much of a percentage (from 0 to 1) to look ahead on a path to influence how strict "orienttopath" is and how much the object will anticipate each curve
http://itween.pixelplacement.com/documentation.php#MoveTo
As you can see in my code:
orienttopath is set to true.
as I understand it looktarget is not usable when using a path (a array of Transform or Vector3) unless you want it to always look at a pos while he moves trough the path (and not rotate in the direction of travel).
looktime (still not totally sure what it means).
lookahead is not set becuse I don’t want it to anticipate the curve (if the default is not zero, please tell me).
Bump.
Really need some help with this…