I have set the iTween path and also I have added a button. When I click on the button the object should start moving along the iTween path.But issue I'm facing is when I run my project at initial stage itself the object is moving on the iTween path which I have set not on the button click. Then I tried out placing the same code for moving upon button click and it'S still not working. Can anybody help me solve this issue and provide me with a piece of code for it. The code is here
void Start () { //iTween.MoveTo(gameObject,iTween.Hash ("path",iTweenPath.GetPath("BoxOut"),"time",5)); iTween.MoveTo(gameObject,iTween.Hash ("path",iTweenPath.GetPath("Pass"),"time",50)); } // Update is called once per frame void Update () { } The above code worked initially, when the project started running, the object starts moving on the path. Then I edited the code and added the code on button click and it's not working anymore. The edited code is below.
void Start () { //iTween.MoveTo(gameObject,iTween.Hash ("path",iTweenPath.GetPath("BoxOut"),"time",5)); iTween.MoveTo(gameObject,iTween.Hash ("path",iTweenPath.GetPath("Pass"),"time",50)); } // Update is called once per frame void Update () { } void OnGUI() { if(GUI.Button(new Rect(100,100,100,100),"gggggg")) { Debug.Log("fffffffffffffffffffffff"); resp=true; } } Its not working. Please help me out with a piece of code.