diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-03-27 17:01:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-27 17:01:28 +0100 |
commit | 1b4204fd76b5edd3e07bf4b1e0609fa870cd6884 (patch) | |
tree | a7f81ab762257ba5b8e7870d3f40f017bb3d8c9c | |
parent | 492153878f9748e84311d1f01a590d24993cd05e (diff) | |
parent | d35eae166c09ccb43e4f366525ad2ea78aaaf913 (diff) |
Merge pull request #27162 from guilhermefelipecgs/fix_26540
StateMachine: Fix sync mode
-rw-r--r-- | scene/animation/animation_node_state_machine.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scene/animation/animation_node_state_machine.cpp b/scene/animation/animation_node_state_machine.cpp index 5df3da93e1..68ad71d01c 100644 --- a/scene/animation/animation_node_state_machine.cpp +++ b/scene/animation/animation_node_state_machine.cpp @@ -440,13 +440,13 @@ float AnimationNodeStateMachinePlayback::process(AnimationNodeStateMachine *sm, bool goto_next = false; - if (switch_mode == AnimationNodeStateMachineTransition::SWITCH_MODE_IMMEDIATE) { - goto_next = fading_from == StringName(); - } else { + if (switch_mode == AnimationNodeStateMachineTransition::SWITCH_MODE_AT_END) { goto_next = next_xfade >= (len_current - pos_current) || loops_current > 0; if (loops_current > 0) { next_xfade = 0; } + } else { + goto_next = fading_from == StringName(); } if (goto_next) { //loops should be used because fade time may be too small or zero and animation may have looped |