StateMachine: Fix sync mode

This commit is contained in:
Guilherme Felipe 2019-03-17 10:12:27 -03:00
parent df7d3708c5
commit d35eae166c
1 changed files with 3 additions and 3 deletions

View File

@ -440,13 +440,13 @@ float AnimationNodeStateMachinePlayback::process(AnimationNodeStateMachine *sm,
bool goto_next = false; bool goto_next = false;
if (switch_mode == AnimationNodeStateMachineTransition::SWITCH_MODE_IMMEDIATE) { if (switch_mode == AnimationNodeStateMachineTransition::SWITCH_MODE_AT_END) {
goto_next = fading_from == StringName();
} else {
goto_next = next_xfade >= (len_current - pos_current) || loops_current > 0; goto_next = next_xfade >= (len_current - pos_current) || loops_current > 0;
if (loops_current > 0) { if (loops_current > 0) {
next_xfade = 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 if (goto_next) { //loops should be used because fade time may be too small or zero and animation may have looped