Animating Polyline Point Positions using DOTween
Hello! I'm trying to animate the points on a Polyline using DOTween.
When I manually set these points using the SetPointPosition API, it works:
//for (int i = 0; i < OutlineRenderer.Count; i++)
//{
// OutlineRenderer.SetPointPosition(i, defaultDrawnHexPointPositions[i] * 1.5f);
//}
However, when I try to do the same thing using the DOTween generic getter/setter API, it doesn't respond at all:
Sequence unitHexHighlighterDefault = DOTween.Sequence();
for (int i = 0; i < OutlineRenderer.Count; i++)
{
unitHexHighlighterDefault.Insert(0f, DOTween.To(() => OutlineRenderer.points[i].point, x => OutlineRenderer.SetPointPosition(i, x), defaultDrawnHexPointPositions[i] * 1.5f, TweenDuration));
}
unitHexHighlighterDefault.SetEase(Ease.Linear);
unitHexHighlighterDefault.Play();
Is there something specific I have to do to be able to animate the points of a Polyline using DOTween?
hmm, I can't see why the second one wouldn't work - have you made sure the tween duration is not 0, and the start/end values are different?