瀏覽代碼

Fixes navigation path reset

Andrea Catania 5 年之前
父節點
當前提交
c7cf624836
共有 2 個文件被更改,包括 2 次插入0 次删除
  1. 1 0
      scene/2d/navigation_agent_2d.cpp
  2. 1 0
      scene/3d/navigation_agent.cpp

+ 1 - 0
scene/2d/navigation_agent_2d.cpp

@@ -215,6 +215,7 @@ void NavigationAgent2D::set_target_location(Vector2 p_location) {
 	navigation_path.clear();
 	target_reached = false;
 	navigation_finished = false;
+	update_frame_id = 0;
 }
 
 Vector2 NavigationAgent2D::get_target_location() const {

+ 1 - 0
scene/3d/navigation_agent.cpp

@@ -234,6 +234,7 @@ void NavigationAgent::set_target_location(Vector3 p_location) {
 	navigation_path.clear();
 	target_reached = false;
 	navigation_finished = false;
+	update_frame_id = 0;
 }
 
 Vector3 NavigationAgent::get_target_location() const {