Browse Source

Navigation2D: Handle location -> position renames

Fixes #6894.
Rémi Verschelde 2 years ago
parent
commit
35ce6f0e43
1 changed files with 5 additions and 5 deletions
  1. 5 5
      tutorials/navigation/navigation_introduction_2d.rst

+ 5 - 5
tutorials/navigation/navigation_introduction_2d.rst

@@ -120,14 +120,14 @@ NavigationServer2D and a NavigationAgent2D for path movement.
         set_movement_target(movement_target_position)
 
     func set_movement_target(movement_target: Vector2):
-        navigation_agent.set_target_location(movement_target)
+        navigation_agent.target_position = movement_target
 
     func _physics_process(delta):
         if navigation_agent.is_navigation_finished():
             return
 
         var current_agent_position: Vector2 = global_transform.origin
-        var next_path_position: Vector2 = navigation_agent.get_next_location()
+        var next_path_position: Vector2 = navigation_agent.get_next_path_position()
 
         var new_velocity: Vector2 = next_path_position - current_agent_position
         new_velocity = new_velocity.normalized()
@@ -150,8 +150,8 @@ NavigationServer2D and a NavigationAgent2D for path movement.
 
         public Vector2 MovementTarget
         {
-            get { return _navigationAgent.TargetLocation; }
-            set { _navigationAgent.TargetLocation = value; }
+            get { return _navigationAgent.TargetPosition; }
+            set { _navigationAgent.TargetPosition = value; }
         }
 
         public override void _Ready()
@@ -179,7 +179,7 @@ NavigationServer2D and a NavigationAgent2D for path movement.
             }
 
             Vector2 currentAgentPosition = GlobalTransform.Origin;
-            Vector2 nextPathPosition = _navigationAgent.GetNextLocation();
+            Vector2 nextPathPosition = _navigationAgent.GetNextPathPosition();
 
             Vector2 newVelocity = (nextPathPosition - currentAgentPosition).Normalized();
             newVelocity *= _movementSpeed;