Hi.I have to get an object to follow a path that is set using the iphone’s touch.The behaviour should be similar to Flight Control
I stored the path in an array of vector3 after getting it from touch positions.
I’m using Vector3.MoveTowards() to move the object on its path.
In order to rotate id tried this:
fPos = transform.position;
followPath(); //move towards..
lPos = transform.position;
if (fPos!=lPos) transform.eulerAngles.z = Mathf.Atan2(lPos.y-fPos.y, lPos.x - fPos.x) * Mathf.Rad2Deg - 90;
The object is “shaking” a lot.
Anyone know any scripts that can help me with this?
Or,if not,can you tell me what am i doing wrong?
P.S.For some reason itween doesn’t work.