Skip to content

Sequence not ordering actions properly #231

@wilczarzgit

Description

@wilczarzgit

Hi there,

I have been trying to use a sequence to execute three actions one after another:

  1. tween
  2. block of code
  3. tween

So I have tried this code:

		var seq = DOTween.Sequence();
		seq.Append(transform.DOMove(Vector3.one, 0.5f));
		seq.AppendCallback(() =>
		{
			DoSomething();
			transform.position = -Vector3.one;
		});
		seq.Append(transform.DOMove(Vector3.zero, 0.5f));

But it doesn't seem to work. Setting the transform inside the callback has no effect, almost as if the first tween is not yet finished? Now if I change the code this way, it works:

		transform.DOMove(Vector3.one, 0.5f).OnComplete(() =>
		{
			DOSomething();
			transform.position = -Vector3.one;
			transform.DOMove(Vector3.zero, 0.5f);
		});

It may be shorter but it's much harder to read, as the elements in the sequence are not clearly visible.

Somewhere online I found a tip to insert intervals between the steps. Is seems very very ugly. The sequence should take care of the order of execution (that's what sequences are for :)

Is this a bug of DOTween?

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions