Hi,
I am using the iTween function for rotate the camera around the object at the same time camera should look at my object.
i am using below script for this function but the move to function i gave the loop this loop function. Problem is in this looptype, at the starting its moving fast at the last its moving slowly. Bu i need the same speed for this loop.
I have to solve this. So help me to do this.
iTween.MoveTo(this.gameObject, iTween.Hash("path", iTweenPath.GetPath("Main"), "time", 10, "loopType", "loop"));
transform.LookAt(targetObj);
Thanks.
and i need to move my object at same speed in the loop.
i have tried this code but its not working.
void Start () {
path = iTweenPath.GetPath("Main");
move = false;
percent = 0.0f;
}
// Update is called once per frame
void Update () {
if(move)
{
percent += 0.005f;
if(percent > 4)
percent = 0;
}
}
void OnGUI()
{
if(GUI.Button(new Rect(0,0,100,30), "Testing"))
{
move = true;
iTween.PutOnPath(gameObject, path, percent);
}
}
I HAVE TRIED THIS COED BUTITS NOT WORKING.
void Start () {
path = iTweenPath.GetPath("Main");
move = false;
percent = 0.0f;
}
// Update is called once per frame
void Update () {
if(move)
{
percent += 0.005f;
if(percent > 4)
percent = 0;
}
}
void OnGUI()
{
if(GUI.Button(new Rect(0,0,100,30), "Testing"))
{
move = true;
iTween.PutOnPath(gameObject, path, percent);
}
}