diff options
author | Guilherme Felipe <guilhermefelipecgs@gmail.com> | 2019-03-17 10:12:27 -0300 |
---|---|---|
committer | Guilherme Felipe <guilhermefelipecgs@gmail.com> | 2019-03-17 10:12:27 -0300 |
commit | d35eae166c09ccb43e4f366525ad2ea78aaaf913 (patch) | |
tree | 39ae2268480e5f91a165d5a005987bd927ec2a64 | |
parent | df7d3708c5b535c3696943322a14ec19a175e30c (diff) |
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 |