Merge pull request #71840 from TokageItLab/fix-travel-reset

Fix weird behavior of teleporting to self-state when `reset_on_teleport` is `false` in StateMachine
This commit is contained in:
Rémi Verschelde 2023-01-22 11:08:57 +01:00
commit 285e6ed9a5
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -411,9 +411,11 @@ double AnimationNodeStateMachinePlayback::_process(AnimationNodeStateMachine *p_
// can't travel, then teleport // can't travel, then teleport
if (p_state_machine->states.has(travel_request)) { if (p_state_machine->states.has(travel_request)) {
path.clear(); path.clear();
current = travel_request; if (current != travel_request || reset_request_on_teleport) {
play_start = true; current = travel_request;
reset_request = reset_request_on_teleport; play_start = true;
reset_request = reset_request_on_teleport;
}
} else { } else {
StringName node = travel_request; StringName node = travel_request;
travel_request = StringName(); travel_request = StringName();