- Home /
itween move to do not end(even it is)
the bottom 2 function dont happen(debug.log show nothing) dont know why even the fireball already stop..any help is appreciated.
using UnityEngine; using System.Collections;
public class fireball : MonoBehaviour {
public GameObject fx01;
void OnTriggerEnter(Collider other){
if (other.tag == "body"){
fx01.SetActive(true);
iTween.MoveTo(fx01,iTween.Hash(
"position",other.transform.position,
"speed",50f,
"oncomplete","onCompleteFromiTween",
"easetype",iTween.EaseType.linear
));
if(fx01.transform.position==other.transform.position){
fx01.SetActive(false);
fx01.transform.localPosition = new Vector3(0, 15f, 0);
Debug.Log("ConstantSpeedMove done");
}
}
}
void onCompleteFromiTween(){
fx01.SetActive(false);
fx01.transform.localPosition = new Vector3(0, 15f, 0);
Debug.Log("ConstantSpeedMove done");
}
}
I don't quite understand the problem you are having. Is the fireball staying still when you want it to move? Is it continuing to move when you want it to stop? Is the fireball not being created at all? Please clarify a little bit.
i want the fireball to hit the target than to inactivate it and set it position back
the problem is it hit the target,than it just stay there. line 15-30 is not call..which is the problem
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
How to use Editor script? 3 Answers
iTween(JS version) could not be used in Unity iPhone? 3 Answers
How do I find the inverse cosine ??? 1 Answer
Itween rotation help 0 Answers