Dotween: Cannot play tween backwards

Created on 13 Jun 2015  路  3Comments  路  Source: Demigiant/dotween

If you create a Tween and then try to play it backwards it doesn't work

C# DOTween.defaultAutoKill = false; _openLevelPanel = levelPanel.transform.DOLocalRotate(new Vector3(0, 180, 0), 1).From().Pause(); _openLevelPanel.Complete(); // This works sending the tween to the end instantly _openLevelPanel.PlayBackwards(); // This doesn't works

DOTween v.1.0.770
Unity v 5.0.0f4

invalid

Most helpful comment

Hi,

Sorry for being late, I erroneously thought I had already answered you. Your tween doesn't play backwards because, by default, it's killed as soon as it completes. Add a SetAutoKill(false) to it if you want to reuse it (like playing it backwards after completion).

Cheers,
Daniele

All 3 comments

Hi,

Sorry for being late, I erroneously thought I had already answered you. Your tween doesn't play backwards because, by default, it's killed as soon as it completes. Add a SetAutoKill(false) to it if you want to reuse it (like playing it backwards after completion).

Cheers,
Daniele

I am using the newest version of DOTween and I am running into the same issue. I do not understand why this Issue got closed as the original code example actually states that autoKill is off. DOTween.defaultAutoKill = false;
I tried to use a simple fade tween and call PlayForward(), a bit later call PlayBackward(), then PlayForward() again. The issue is, if the first forward has completed, calling
PlayBackward();
PlayForward();
starts the tween from the beginning. I would expect it to stay at the end, because PlayBackward() never could run to the beginning:

sequence.PlayForward();
// let it complete
sequence.PlayBackward();
sequence.PlayForward(); // Note: no delay after calling backward
// tween starts from the beginning <-- unexpected

Ouch you're right. It's a different problem from the one @SharpEdgeMarshall had though (Fabio I didn't notice you had set AutoKill to false, but I can't replicate your issue so if you're still encountering it tell me more).

@Metallix, in your case it's because you're calling PlayForward the same frame of a PlayBackwards, immediately after, on an already completed tween. That's indeed a bug and this update (1.2.251) should fix it, can you check it out and let me know if everything's alright on your side too?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Mukarillo picture Mukarillo  路  4Comments

ShadowTM picture ShadowTM  路  4Comments

koblongata picture koblongata  路  9Comments

leeprobert picture leeprobert  路  5Comments

jizc picture jizc  路  10Comments