mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-05 22:09:56 +03:00
Fix example script in Using NavigationPaths (#8358)
This commit is contained in:
committed by
Max Hilbrunner
parent
9d9e287939
commit
ab70d6788f
@@ -80,10 +80,11 @@ the default navigation map by setting the target position with ``set_movement_ta
|
||||
.. tabs::
|
||||
.. code-tab:: gdscript GDScript
|
||||
|
||||
@onready var default_3d_map_rid: RID = get_world_3d().get_navigation_map()
|
||||
|
||||
var movement_speed: float = 4.0
|
||||
var movement_delta: float
|
||||
var path_point_margin: float = 0.5
|
||||
var default_3d_map_rid: RID = get_world_3d().get_navigation_map()
|
||||
|
||||
var current_path_index: int = 0
|
||||
var current_path_point: Vector3
|
||||
@@ -109,7 +110,7 @@ the default navigation map by setting the target position with ``set_movement_ta
|
||||
if current_path.is_empty():
|
||||
return
|
||||
|
||||
movement_delta = move_speed * delta
|
||||
movement_delta = movement_speed * delta
|
||||
|
||||
if global_transform.origin.distance_to(current_path_point) <= path_point_margin:
|
||||
current_path_index += 1
|
||||
|
||||
Reference in New Issue
Block a user