- Home /
Stop iTween destroying all tweens
Hey guys, I'm using iTween.Stop, because iTween path is not colliding with another objects.
So I used OnCollisionEnter to Stop a tween, but when I stop one, all the scene tweens are deleted, not the only one that I want.
Here is my code.
public GameObject bola01;
public GameObject bola2;
public GameObject bola3;
public GameObject bola4;
public GameObject bola5;
void Start()
{
bola01 = GameObject.Find("Bola");
bola2 = GameObject.Find("Bola2");
bola3 = GameObject.Find("Bola3");
bola4 = GameObject.Find("Bola4");
bola5 = GameObject.Find("Bola5");
}
void OnCollisionEnter(Collision hit)
{
if(hit.gameObject.tag == "Goleiro")
{
iTween.Stop(bola01);
StartCoroutine(voltaTween());
}
}
IEnumerator voltaTween()
{
yield return new WaitForSeconds(1F);
iTween.Resume();
}
}
You can use iTween.PointOnPath() or iTween.PutOnPath() and then not worry about tweens getting destroyed.
That don't work in my case, its a soccer game with multiple random paths, and this paths are the balls acting with animation, if I do this I will not have the bouncy effect of the soccer ball, the collision that this ball do is with the goalkepper. =/ But thank you for help, but I need to use iTween.Stop
Your answer
Follow this Question
Related Questions
itween move to do not end(even it is) 0 Answers
using itween to move objects in the 6 degrees of freedom 1 Answer
iTween - Traveling around a cylinder 2 Answers
Itwen MoveTo - jump 1 Answer