You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following script creates a new 3D navmesh from the mesh of a GridMap item, clears the current grid cells and adds new procedual grid cells with the new navmesh.
226
+
The following script creates a new 3D navigation mesh for each GridMap items, clears the current grid cells and adds new procedual grid cells with the new navigation mesh.
221
227
222
228
.. tabs::
223
229
.. code-tab:: gdscript GDScript
@@ -227,12 +233,21 @@ The following script creates a new 3D navmesh from the mesh of a GridMap item, c
227
233
# enable navigation mesh for grid items
228
234
set_bake_navigation(true)
229
235
230
-
# get mesh from grid item, bake and set a new navigation mesh for the library
236
+
# get grid items, create and set a new navigation mesh for each item in the MeshLibrary
231
237
var gridmap_item_list: PackedInt32Array = mesh_library.get_item_list()
232
238
for item in gridmap_item_list:
233
-
var item_mesh: Mesh = mesh_library.get_item_mesh(item)
234
239
var new_item_navigation_mesh: NavigationMesh = NavigationMesh.new()
0 commit comments