Browse Source

Fix wrong lines of code in the "Using NavigationMaps" page

NavigationServer2D and 3D's `map_set_active()` method takes two arguments, the map RID and the boolean. The docs only contained the boolean, resulting in wrong code.
Emmanouil Papadeas 1 year ago
parent
commit
fa9cba4d8d
1 changed files with 2 additions and 2 deletions
  1. 2 2
      tutorials/navigation/navigation_using_navigationmaps.rst

+ 2 - 2
tutorials/navigation/navigation_using_navigationmaps.rst

@@ -64,7 +64,7 @@ Navigation regions and avoidance agents can only be part of a single navigation
 
 
     func _ready() -> void:
     func _ready() -> void:
         var new_navigation_map: RID = NavigationServer2D.map_create()
         var new_navigation_map: RID = NavigationServer2D.map_create()
-        NavigationServer2D.map_set_active(true)
+        NavigationServer2D.map_set_active(new_navigation_map, true)
 
 
  .. code-tab:: gdscript 3D GDScript
  .. code-tab:: gdscript 3D GDScript
 
 
@@ -72,7 +72,7 @@ Navigation regions and avoidance agents can only be part of a single navigation
 
 
     func _ready() -> void:
     func _ready() -> void:
         var new_navigation_map: RID = NavigationServer3D.map_create()
         var new_navigation_map: RID = NavigationServer3D.map_create()
-        NavigationServer3D.map_set_active(true)
+        NavigationServer3D.map_set_active(new_navigation_map, true)
 
 
 .. note::
 .. note::