Here is the code for DoMove
case doTweenType.DoMove:
Tweener followtween = _target.transform.DOMove(to.Value, duration.Value, snapping.Value).SetAs(setFinal);
followtween.OnUpdate(() =>
{
if (toObject.Value != null)
{
to.Value = go.transform.position;
}
if (prevTargetPos != to.Value)
{
prevTargetPos = to.Value;
followtween.ChangeEndValue(to.Value, duration.Value, true).SetAs(setFinal).Restart();
}
});
but for some reason I am trying to figure out, none of the DoMoveX, Y, or Z work when the object moves. It sets the object following to 0 when the end value has changed...
case doTweenType.DoMoveX:
float x = to.Value.x;
Tweener followtweenx = _target.transform.DOMoveX(x, duration.Value, snapping.Value).SetAs(setFinal);
followtweenx.OnUpdate(() =>
{
if (toObject.Value != null)
{
x = go.transform.position.x;
}
if (prevTargetPos.x != x)
{
prevTargetPos.x = to.Value.x;
followtweenx.ChangeEndValue(x, duration.Value, true).SetAs(setFinal).Restart();
}
});
I'll keep trying but if you got any ideas please let me know