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
1 changed files with 5 additions and 3 deletions

View File

@ -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();