summaryrefslogtreecommitdiffstats
path: root/scene/animation
diff options
context:
space:
mode:
authorSilc Lizard (Tokage) Renew <61938263+TokageItLab@users.noreply.github.com>2024-05-11 15:47:21 +0900
committerSilc Lizard (Tokage) Renew <61938263+TokageItLab@users.noreply.github.com>2024-05-11 15:47:21 +0900
commitd654acbd39a0902f5b80701af4f8e7aa860d7272 (patch)
tree7dd9263187d450613abcbad064dc5f614ae8394c /scene/animation
parent2ba22d1554ded08094e3869a83bd87487266ad38 (diff)
downloadredot-engine-d654acbd39a0902f5b80701af4f8e7aa860d7272.tar.gz
Invert start offset on AnimationNode custom timeline
Diffstat (limited to 'scene/animation')
-rw-r--r--scene/animation/animation_blend_tree.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/scene/animation/animation_blend_tree.cpp b/scene/animation/animation_blend_tree.cpp
index f3385b4cdc..1cf235a807 100644
--- a/scene/animation/animation_blend_tree.cpp
+++ b/scene/animation/animation_blend_tree.cpp
@@ -194,8 +194,8 @@ AnimationNode::NodeTimeInfo AnimationNodeAnimation::_process(const AnimationMixe
nti.is_just_looped = is_just_looped;
// 3. Progress for Animation.
- double prev_playback_time = prev_time - start_offset;
- double cur_playback_time = cur_time - start_offset;
+ double prev_playback_time = prev_time + start_offset;
+ double cur_playback_time = cur_time + start_offset;
if (stretch_time_scale) {
double mlt = anim_size / cur_len;
cur_playback_time *= mlt;
@@ -241,7 +241,7 @@ AnimationNode::NodeTimeInfo AnimationNodeAnimation::_process(const AnimationMixe
process_state->tree->call_deferred(SNAME("emit_signal"), "animation_started", animation);
}
// Finished.
- if (prev_time - start_offset < anim_size && cur_playback_time >= anim_size) {
+ if (prev_time + start_offset < anim_size && cur_playback_time >= anim_size) {
process_state->tree->call_deferred(SNAME("emit_signal"), "animation_finished", animation);
}
}