iTween MoveTo and RotateTo at the same time produce odd results

Was wondering if anyone has some insight on why this is happening:

If I issue the following iTweens, which should move the object and rotate it 180 degrees at the same time:

gameObject.MoveBy (new Vector3 (10, 0, 0), 1, 0);
gameObject.RotateTo(new Vector3 (0, 0, 180), 1, 0);

It moves, and rotates, but it moves in a backwards C pattern and the “path” ends up creating what could be described as a half circle.

If I do the following however (delay the second tween 1 second):

gameObject.MoveBy (new Vector3 (10, 0, 0), 1, 0);
gameObject.RotateTo(new Vector3 (0, 0, 180), 1, 1);

It moves left to right, then rotates 180 degrees on it’s center point, as would be expected.

The problem is when I run them both together, it doesn’t just move it left to right while rotating on it’s center point.

Anyone explain this?

Thanks!

I know that’s an old question but it may help somebody.

I just had the same odd results as you, using RotateBy() instead of RotateTo() with 2D Tools.
After searching for a while, I’ve found out that it seems to be an old bug in iTween:

My current solution:

  • Create a Empty GameObject and attach the MoveBy() script to it;
  • Make your original object a child of the empty game object and attach the RotateTo() script to it;

I haven’t made extensive tests, but I believe this solution works for other iTween’s functions as well.