From a6d8afc90ceb56a8bcb8b98efdd8a4ee5ff40b11 Mon Sep 17 00:00:00 2001 From: Silc Renew Date: Sun, 22 Jan 2023 16:16:48 +0900 Subject: Fix weird behavior of teleporting to self-state when reset is false --- scene/animation/animation_node_state_machine.cpp | 8 +++++--- 1 file 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(); -- cgit v1.2.3