91
DOTween & DOTween Pro / Re: Tweening to a certain waypoint in a Path Tween
« Last post by Daniele on March 30, 2016, 12:03:55 PM »
Tween myPathTween;
void Start()
{
// Get tween from DOTweenPath and attach callback
myPathTween = this.GetComponent<DOTweenPath>().GetTween();
myPathTween.OnWaypointChange(WPCallback);
}
void WPCallback(int waypointIndex)
{
if (waypointIndex == 3) myPathTween.Pause();
}
// Call this method when you're ready to resume the tween
void ResumeTween()
{
myPathTween.Play();
}