diff options
author | Silc Renew <tokage.it.lab@gmail.com> | 2023-01-22 16:16:48 +0900 |
---|---|---|
committer | Silc Renew <tokage.it.lab@gmail.com> | 2023-01-22 16:16:48 +0900 |
commit | a6d8afc90ceb56a8bcb8b98efdd8a4ee5ff40b11 (patch) | |
tree | 8e936f3ca91be193eb8e43fc5d838d6b6e586e11 /scene | |
parent | c3539b4561f9b4d7dc4ba1c5859217e7fbf9c6fe (diff) |
Fix weird behavior of teleporting to self-state when reset is false
Diffstat (limited to 'scene')
-rw-r--r-- | scene/animation/animation_node_state_machine.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scene/animation/animation_node_state_machine.cpp b/scene/animation/animation_node_state_machine.cpp index 2c79e5fe06..a1191075ec 100644 --- a/scene/animation/animation_node_state_machine.cpp +++ b/scene/animation/animation_node_state_machine.cpp @@ -411,9 +411,11 @@ double AnimationNodeStateMachinePlayback::_process(AnimationNodeStateMachine *p_ // can't travel, then teleport if (p_state_machine->states.has(travel_request)) { path.clear(); - current = travel_request; - play_start = true; - reset_request = reset_request_on_teleport; + if (current != travel_request || reset_request_on_teleport) { + current = travel_request; + play_start = true; + reset_request = reset_request_on_teleport; + } } else { StringName node = travel_request; travel_request = StringName(); |