Demigiant Forum
Unity Assets => DOTween & DOTween Pro => Topic started by: cem on January 18, 2016, 06:30:27 PM
-
I have a moving platform where I want to tween my object to. From what i understood it's not possible; so the end position must be 'static' . Can someone confirm ?
Thanks !
-
You can add an OnUpdate to the tween like this:
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);
}
});