itween PutOnPath rotating

hi guys i understand how putonpath works, but how can i make the pathed object tween the rotation aswell as the position. note this is not to make the object look at the path, this is to make the objects rotation face the same as the transform objects it follows. here is what i have to make it only follow the transform.

public float percentage;
	public Transform[] path = new Transform[3];

	void Update () {
	iTween.PutOnPath(gameObject, path, percentage);
	
	}

1 Answer

1

You are going to need to use 2 objects:

1- Object to put on path (parent)
2- The object with your graphics ( child )

Nest one within the other, that will make the child follow the path of its parent ( aka the object following the itween path ) and it will give you free reign to rotate your child object without it being restrained by itween path.

hey soz the object doesnt need free rotation, it needs to rotate in proportion with the percentage, just like the game object. so if the transform array, had on the 1st transform, a rotation on the x axis of 90 degrees, then on the 2nd transform 180 degrees and on the last one 270 degrees, it would interpolate the rotation just as it does the transform with the putonpath function.