1
DOTween & DOTween Pro / Re: Tweening with a moving endPosition
« on: February 17, 2016, 10:19:16 PM »
You can add an OnUpdate to the tween like this:
Code: [Select]
Tweener tweener = target.DOMove(followTarget.position, speed).SetSpeedBased(true);
tweener.OnUpdate(delegate () {
// if the tween isn't close enough to the target, set the end position to the target again
if(Vector3.Distance(target.position, followTarget.position) > completionRadius) {
tweener.ChangeEndValue(followTarget.position, true);
}
});