Skip to content

Commit

Permalink
Merge pull request #79879 from KoBeWi/the_tweenld
Browse files Browse the repository at this point in the history
Improve and clarify paused Tweens
  • Loading branch information
YuriSizov committed Jul 25, 2023
2 parents fc1b392 + dbecf8b commit a581bf0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions doc/classes/Tween.xml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@
<return type="void" />
<description>
Pauses the tweening. The animation can be resumed by using [method play].
[b]Note:[/b] If a Tween is paused and not bound to any node, it will exist indefinitely until manually started or invalidated. If you lose a reference to such Tween, you can retrieve it using [method SceneTree.get_processed_tweens].
</description>
</method>
<method name="play">
Expand Down Expand Up @@ -273,6 +274,7 @@
<return type="void" />
<description>
Stops the tweening and resets the [Tween] to its initial state. This will not remove any appended [Tweener]s.
[b]Note:[/b] If a Tween is stopped and not bound to any node, it will exist indefinitely until manually started or invalidated. If you lose a reference to such Tween, you can retrieve it using [method SceneTree.get_processed_tweens].
</description>
</method>
<method name="tween_callback">
Expand Down
8 changes: 4 additions & 4 deletions scene/animation/tween.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,6 @@ bool Tween::step(double p_delta) {
return false;
}

if (!running) {
return true;
}

if (is_bound) {
Node *node = get_bound_node();
if (node) {
Expand All @@ -299,6 +295,10 @@ bool Tween::step(double p_delta) {
}
}

if (!running) {
return true;
}

if (!started) {
if (tweeners.is_empty()) {
String tween_id;
Expand Down

0 comments on commit a581bf0

Please sign in to comment.