Dotween: Unwanted delay between tweens in Sequence

Created on 10 Jun 2019  路  4Comments  路  Source: Demigiant/dotween

Hello,
I am creating a Sequence to move some pieces in the screen. Each tween represent 1 moviment step, I am feeding a queue with moviments and than retrieving them to add each tween to the sequence to be played.
The movement itself is perfect, but there is an annoying delay between each step. @Demigiant can you help me with that?

Here is the code:

var timeForEachSection = time / Piece.FallMoves.Count;
var fallSequence = DOTween.Sequence();
var position = transform.localPosition;
while (Piece.FallMoves.Count > 0)
{
    var vec2move = (Vector2)Piece.DequeueFallMove() * PieceSize * -1;
    position += new Vector3(vec2move.y, vec2move.x, 0);
    fallSequence.Append(transform.DOLocalMove(position, timeForEachSection)).SetEase(Ease.Linear);
}

fallSequence.OnComplete(onComplete.Invoke).SetEase(Ease.Linear);

And here is the result:
example

Most helpful comment

Ahoy! :)

You're applying the ease to the Sequence (which is always Linear by default) while instead you want to apply it to the nested tween (so just move it inside the left parenthesis).

A tween's ease controls the tween as usual, while a Sequence ease changes the overall time-animation flow of the Sequence but as an extra layer applied to the original eases inside the Sequence itself.

All 4 comments

Ahoy! :)

You're applying the ease to the Sequence (which is always Linear by default) while instead you want to apply it to the nested tween (so just move it inside the left parenthesis).

A tween's ease controls the tween as usual, while a Sequence ease changes the overall time-animation flow of the Sequence but as an extra layer applied to the original eases inside the Sequence itself.

P.S. To explain better, the delay you're seeing is the default Ease.OutQuad slowing down toward the end of the animation, and then speeding up when the next tween starts from 0

That was pretty dumb from me haha.
I am sorry to waste your time and thank you very much!

Nono, it happens to all of us, no worries :D

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jul-ya picture jul-ya  路  12Comments

Denis535 picture Denis535  路  5Comments

Dentrax picture Dentrax  路  10Comments

dooprod picture dooprod  路  11Comments

mrtenda picture mrtenda  路  4Comments