Closed Garfounkel closed 2 years ago
Ahoy!
That is definitely not the expected behaviour, and considering how DOTween works I'd say it's impossible for it to start looping between different values unless you recreated that Sequence, which I think is the problem somewhere. Could you add a log when you create it, to check that out? You're probably recreating it somewhere.
Cheers, Daniele
P.S. Marking this invalid because I'm sure the pause is not the issue, but let me know.
Never mind, you were correct. I completely missed the fact that I was recreating the Sequence on each call to OnEnable
. My bad, thanks for your prompt answer!
And thanks for making DoTween, it's a great library.
Great, glad you solved it :)
When pausing an infinite looped sequence with
_seq.Pause()
I expected a later call to_seq.Play()
to resume the tween from where it left off. However, it starts from the current state like if it was a new tween but without actual context from the earlier pause.Maybe an example will be more clear: let's say I tween the position from (0, 0) to (1, 1) and back infinitely. Then I pause the tween when it happens to be around (0.9, 0.9). Then I later resume the tween with
_seq.Play()
. At this point the object is positioned at (0.9, 0.9) but the tween starts like if it was new. Its target is (1, 1), but its starting position is now (0.9, 0.9), therefor it now goes back and forth between (0.9, 0.9) and (1, 1) instead of (0, 0) to (1, 1) like I expected (since I wanted to resume the paused tween). If this is the expected behavior, then it feels likePause
should really be calledStop
. Am I missing something?Note that I'm calling
_seq.Pause()
and_seq.Play()
respectively inOnDisable()
andOnEnable()
if that changes anything.