:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/NavigationPolygon.xml. .. _class_NavigationPolygon: NavigationPolygon ================= **Experimental:** This class may be changed or removed in future versions. **Inherits:** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` A 2D navigation mesh that describes a traversable surface for pathfinding. .. rst-class:: classref-introduction-group Description ----------- A navigation mesh can be created either by baking it with the help of the :ref:`NavigationServer2D`, or by adding vertices and convex polygon indices arrays manually. To bake a navigation mesh at least one outline needs to be added that defines the outer bounds of the baked area. .. tabs:: .. code-tab:: gdscript var new_navigation_mesh = NavigationPolygon.new() var bounding_outline = PackedVector2Array([Vector2(0, 0), Vector2(0, 50), Vector2(50, 50), Vector2(50, 0)]) new_navigation_mesh.add_outline(bounding_outline) NavigationServer2D.bake_from_source_geometry_data(new_navigation_mesh, NavigationMeshSourceGeometryData2D.new()); $NavigationRegion2D.navigation_polygon = new_navigation_mesh .. code-tab:: csharp var newNavigationMesh = new NavigationPolygon(); var boundingOutline = new Vector2[] { new Vector2(0, 0), new Vector2(0, 50), new Vector2(50, 50), new Vector2(50, 0) }; newNavigationMesh.AddOutline(boundingOutline); NavigationServer2D.BakeFromSourceGeometryData(newNavigationMesh, new NavigationMeshSourceGeometryData2D()); GetNode("NavigationRegion2D").NavigationPolygon = newNavigationMesh; Adding vertices and polygon indices manually. .. tabs:: .. code-tab:: gdscript var new_navigation_mesh = NavigationPolygon.new() var new_vertices = PackedVector2Array([Vector2(0, 0), Vector2(0, 50), Vector2(50, 50), Vector2(50, 0)]) new_navigation_mesh.vertices = new_vertices var new_polygon_indices = PackedInt32Array([0, 1, 2, 3]) new_navigation_mesh.add_polygon(new_polygon_indices) $NavigationRegion2D.navigation_polygon = new_navigation_mesh .. code-tab:: csharp var newNavigationMesh = new NavigationPolygon(); var newVertices = new Vector2[] { new Vector2(0, 0), new Vector2(0, 50), new Vector2(50, 50), new Vector2(50, 0) }; newNavigationMesh.Vertices = newVertices; var newPolygonIndices = new int[] { 0, 1, 2, 3 }; newNavigationMesh.AddPolygon(newPolygonIndices); GetNode("NavigationRegion2D").NavigationPolygon = newNavigationMesh; .. rst-class:: classref-introduction-group Tutorials --------- - :doc:`Using NavigationMeshes <../tutorials/navigation/navigation_using_navigationmeshes>` - `Navigation Polygon 2D Demo `__ .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ | :ref:`float` | :ref:`agent_radius` | ``10.0`` | +------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ | :ref:`Rect2` | :ref:`baking_rect` | ``Rect2(0, 0, 0, 0)`` | +------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ | :ref:`Vector2` | :ref:`baking_rect_offset` | ``Vector2(0, 0)`` | +------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ | :ref:`float` | :ref:`border_size` | ``0.0`` | +------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ | :ref:`float` | :ref:`cell_size` | ``1.0`` | +------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ | :ref:`int` | :ref:`parsed_collision_mask` | ``4294967295`` | +------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ | :ref:`ParsedGeometryType` | :ref:`parsed_geometry_type` | ``2`` | +------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ | :ref:`SamplePartitionType` | :ref:`sample_partition_type` | ``0`` | +------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ | :ref:`StringName` | :ref:`source_geometry_group_name` | ``&"navigation_polygon_source_geometry_group"`` | +------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ | :ref:`SourceGeometryMode` | :ref:`source_geometry_mode` | ``0`` | +------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`add_outline`\ (\ outline\: :ref:`PackedVector2Array`\ ) | +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`add_outline_at_index`\ (\ outline\: :ref:`PackedVector2Array`, index\: :ref:`int`\ ) | +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`add_polygon`\ (\ polygon\: :ref:`PackedInt32Array`\ ) | +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`clear`\ (\ ) | +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`clear_outlines`\ (\ ) | +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`clear_polygons`\ (\ ) | +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`NavigationMesh` | :ref:`get_navigation_mesh`\ (\ ) | +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PackedVector2Array` | :ref:`get_outline`\ (\ idx\: :ref:`int`\ ) |const| | +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_outline_count`\ (\ ) |const| | +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`get_parsed_collision_mask_value`\ (\ layer_number\: :ref:`int`\ ) |const| | +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PackedInt32Array` | :ref:`get_polygon`\ (\ idx\: :ref:`int`\ ) | +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_polygon_count`\ (\ ) |const| | +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PackedVector2Array` | :ref:`get_vertices`\ (\ ) |const| | +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`make_polygons_from_outlines`\ (\ ) | +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`remove_outline`\ (\ idx\: :ref:`int`\ ) | +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_outline`\ (\ idx\: :ref:`int`, outline\: :ref:`PackedVector2Array`\ ) | +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_parsed_collision_mask_value`\ (\ layer_number\: :ref:`int`, value\: :ref:`bool`\ ) | +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_vertices`\ (\ vertices\: :ref:`PackedVector2Array`\ ) | +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Enumerations ------------ .. _enum_NavigationPolygon_SamplePartitionType: .. rst-class:: classref-enumeration enum **SamplePartitionType**: :ref:`🔗` .. _class_NavigationPolygon_constant_SAMPLE_PARTITION_CONVEX_PARTITION: .. rst-class:: classref-enumeration-constant :ref:`SamplePartitionType` **SAMPLE_PARTITION_CONVEX_PARTITION** = ``0`` Convex partitioning that yields navigation mesh with convex polygons. .. _class_NavigationPolygon_constant_SAMPLE_PARTITION_TRIANGULATE: .. rst-class:: classref-enumeration-constant :ref:`SamplePartitionType` **SAMPLE_PARTITION_TRIANGULATE** = ``1`` Triangulation partitioning that yields navigation mesh with triangle polygons. .. _class_NavigationPolygon_constant_SAMPLE_PARTITION_MAX: .. rst-class:: classref-enumeration-constant :ref:`SamplePartitionType` **SAMPLE_PARTITION_MAX** = ``2`` Represents the size of the :ref:`SamplePartitionType` enum. .. rst-class:: classref-item-separator ---- .. _enum_NavigationPolygon_ParsedGeometryType: .. rst-class:: classref-enumeration enum **ParsedGeometryType**: :ref:`🔗` .. _class_NavigationPolygon_constant_PARSED_GEOMETRY_MESH_INSTANCES: .. rst-class:: classref-enumeration-constant :ref:`ParsedGeometryType` **PARSED_GEOMETRY_MESH_INSTANCES** = ``0`` Parses mesh instances as obstruction geometry. This includes :ref:`Polygon2D`, :ref:`MeshInstance2D`, :ref:`MultiMeshInstance2D`, and :ref:`TileMap` nodes. Meshes are only parsed when they use a 2D vertices surface format. .. _class_NavigationPolygon_constant_PARSED_GEOMETRY_STATIC_COLLIDERS: .. rst-class:: classref-enumeration-constant :ref:`ParsedGeometryType` **PARSED_GEOMETRY_STATIC_COLLIDERS** = ``1`` Parses :ref:`StaticBody2D` and :ref:`TileMap` colliders as obstruction geometry. The collider should be in any of the layers specified by :ref:`parsed_collision_mask`. .. _class_NavigationPolygon_constant_PARSED_GEOMETRY_BOTH: .. rst-class:: classref-enumeration-constant :ref:`ParsedGeometryType` **PARSED_GEOMETRY_BOTH** = ``2`` Both :ref:`PARSED_GEOMETRY_MESH_INSTANCES` and :ref:`PARSED_GEOMETRY_STATIC_COLLIDERS`. .. _class_NavigationPolygon_constant_PARSED_GEOMETRY_MAX: .. rst-class:: classref-enumeration-constant :ref:`ParsedGeometryType` **PARSED_GEOMETRY_MAX** = ``3`` Represents the size of the :ref:`ParsedGeometryType` enum. .. rst-class:: classref-item-separator ---- .. _enum_NavigationPolygon_SourceGeometryMode: .. rst-class:: classref-enumeration enum **SourceGeometryMode**: :ref:`🔗` .. _class_NavigationPolygon_constant_SOURCE_GEOMETRY_ROOT_NODE_CHILDREN: .. rst-class:: classref-enumeration-constant :ref:`SourceGeometryMode` **SOURCE_GEOMETRY_ROOT_NODE_CHILDREN** = ``0`` Scans the child nodes of the root node recursively for geometry. .. _class_NavigationPolygon_constant_SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN: .. rst-class:: classref-enumeration-constant :ref:`SourceGeometryMode` **SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN** = ``1`` Scans nodes in a group and their child nodes recursively for geometry. The group is specified by :ref:`source_geometry_group_name`. .. _class_NavigationPolygon_constant_SOURCE_GEOMETRY_GROUPS_EXPLICIT: .. rst-class:: classref-enumeration-constant :ref:`SourceGeometryMode` **SOURCE_GEOMETRY_GROUPS_EXPLICIT** = ``2`` Uses nodes in a group for geometry. The group is specified by :ref:`source_geometry_group_name`. .. _class_NavigationPolygon_constant_SOURCE_GEOMETRY_MAX: .. rst-class:: classref-enumeration-constant :ref:`SourceGeometryMode` **SOURCE_GEOMETRY_MAX** = ``3`` Represents the size of the :ref:`SourceGeometryMode` enum. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_NavigationPolygon_property_agent_radius: .. rst-class:: classref-property :ref:`float` **agent_radius** = ``10.0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_agent_radius**\ (\ value\: :ref:`float`\ ) - :ref:`float` **get_agent_radius**\ (\ ) The distance to erode/shrink the walkable surface when baking the navigation mesh. .. rst-class:: classref-item-separator ---- .. _class_NavigationPolygon_property_baking_rect: .. rst-class:: classref-property :ref:`Rect2` **baking_rect** = ``Rect2(0, 0, 0, 0)`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_baking_rect**\ (\ value\: :ref:`Rect2`\ ) - :ref:`Rect2` **get_baking_rect**\ (\ ) If the baking :ref:`Rect2` has an area the navigation mesh baking will be restricted to its enclosing area. .. rst-class:: classref-item-separator ---- .. _class_NavigationPolygon_property_baking_rect_offset: .. rst-class:: classref-property :ref:`Vector2` **baking_rect_offset** = ``Vector2(0, 0)`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_baking_rect_offset**\ (\ value\: :ref:`Vector2`\ ) - :ref:`Vector2` **get_baking_rect_offset**\ (\ ) The position offset applied to the :ref:`baking_rect` :ref:`Rect2`. .. rst-class:: classref-item-separator ---- .. _class_NavigationPolygon_property_border_size: .. rst-class:: classref-property :ref:`float` **border_size** = ``0.0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_border_size**\ (\ value\: :ref:`float`\ ) - :ref:`float` **get_border_size**\ (\ ) The size of the non-navigable border around the bake bounding area defined by the :ref:`baking_rect` :ref:`Rect2`. In conjunction with the :ref:`baking_rect` the border size can be used to bake tile aligned navigation meshes without the tile edges being shrunk by :ref:`agent_radius`. .. rst-class:: classref-item-separator ---- .. _class_NavigationPolygon_property_cell_size: .. rst-class:: classref-property :ref:`float` **cell_size** = ``1.0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_cell_size**\ (\ value\: :ref:`float`\ ) - :ref:`float` **get_cell_size**\ (\ ) The cell size used to rasterize the navigation mesh vertices. Must match with the cell size on the navigation map. .. rst-class:: classref-item-separator ---- .. _class_NavigationPolygon_property_parsed_collision_mask: .. rst-class:: classref-property :ref:`int` **parsed_collision_mask** = ``4294967295`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_parsed_collision_mask**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_parsed_collision_mask**\ (\ ) The physics layers to scan for static colliders. Only used when :ref:`parsed_geometry_type` is :ref:`PARSED_GEOMETRY_STATIC_COLLIDERS` or :ref:`PARSED_GEOMETRY_BOTH`. .. rst-class:: classref-item-separator ---- .. _class_NavigationPolygon_property_parsed_geometry_type: .. rst-class:: classref-property :ref:`ParsedGeometryType` **parsed_geometry_type** = ``2`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_parsed_geometry_type**\ (\ value\: :ref:`ParsedGeometryType`\ ) - :ref:`ParsedGeometryType` **get_parsed_geometry_type**\ (\ ) Determines which type of nodes will be parsed as geometry. See :ref:`ParsedGeometryType` for possible values. .. rst-class:: classref-item-separator ---- .. _class_NavigationPolygon_property_sample_partition_type: .. rst-class:: classref-property :ref:`SamplePartitionType` **sample_partition_type** = ``0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_sample_partition_type**\ (\ value\: :ref:`SamplePartitionType`\ ) - :ref:`SamplePartitionType` **get_sample_partition_type**\ (\ ) Partitioning algorithm for creating the navigation mesh polys. See :ref:`SamplePartitionType` for possible values. .. rst-class:: classref-item-separator ---- .. _class_NavigationPolygon_property_source_geometry_group_name: .. rst-class:: classref-property :ref:`StringName` **source_geometry_group_name** = ``&"navigation_polygon_source_geometry_group"`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_source_geometry_group_name**\ (\ value\: :ref:`StringName`\ ) - :ref:`StringName` **get_source_geometry_group_name**\ (\ ) The group name of nodes that should be parsed for baking source geometry. Only used when :ref:`source_geometry_mode` is :ref:`SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN` or :ref:`SOURCE_GEOMETRY_GROUPS_EXPLICIT`. .. rst-class:: classref-item-separator ---- .. _class_NavigationPolygon_property_source_geometry_mode: .. rst-class:: classref-property :ref:`SourceGeometryMode` **source_geometry_mode** = ``0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_source_geometry_mode**\ (\ value\: :ref:`SourceGeometryMode`\ ) - :ref:`SourceGeometryMode` **get_source_geometry_mode**\ (\ ) The source of the geometry used when baking. See :ref:`SourceGeometryMode` for possible values. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_NavigationPolygon_method_add_outline: .. rst-class:: classref-method |void| **add_outline**\ (\ outline\: :ref:`PackedVector2Array`\ ) :ref:`🔗` Appends a :ref:`PackedVector2Array` that contains the vertices of an outline to the internal array that contains all the outlines. .. rst-class:: classref-item-separator ---- .. _class_NavigationPolygon_method_add_outline_at_index: .. rst-class:: classref-method |void| **add_outline_at_index**\ (\ outline\: :ref:`PackedVector2Array`, index\: :ref:`int`\ ) :ref:`🔗` Adds a :ref:`PackedVector2Array` that contains the vertices of an outline to the internal array that contains all the outlines at a fixed position. .. rst-class:: classref-item-separator ---- .. _class_NavigationPolygon_method_add_polygon: .. rst-class:: classref-method |void| **add_polygon**\ (\ polygon\: :ref:`PackedInt32Array`\ ) :ref:`🔗` Adds a polygon using the indices of the vertices you get when calling :ref:`get_vertices`. .. rst-class:: classref-item-separator ---- .. _class_NavigationPolygon_method_clear: .. rst-class:: classref-method |void| **clear**\ (\ ) :ref:`🔗` Clears the internal arrays for vertices and polygon indices. .. rst-class:: classref-item-separator ---- .. _class_NavigationPolygon_method_clear_outlines: .. rst-class:: classref-method |void| **clear_outlines**\ (\ ) :ref:`🔗` Clears the array of the outlines, but it doesn't clear the vertices and the polygons that were created by them. .. rst-class:: classref-item-separator ---- .. _class_NavigationPolygon_method_clear_polygons: .. rst-class:: classref-method |void| **clear_polygons**\ (\ ) :ref:`🔗` Clears the array of polygons, but it doesn't clear the array of outlines and vertices. .. rst-class:: classref-item-separator ---- .. _class_NavigationPolygon_method_get_navigation_mesh: .. rst-class:: classref-method :ref:`NavigationMesh` **get_navigation_mesh**\ (\ ) :ref:`🔗` Returns the :ref:`NavigationMesh` resulting from this navigation polygon. This navigation mesh can be used to update the navigation mesh of a region with the :ref:`NavigationServer3D.region_set_navigation_mesh` API directly (as 2D uses the 3D server behind the scene). .. rst-class:: classref-item-separator ---- .. _class_NavigationPolygon_method_get_outline: .. rst-class:: classref-method :ref:`PackedVector2Array` **get_outline**\ (\ idx\: :ref:`int`\ ) |const| :ref:`🔗` Returns a :ref:`PackedVector2Array` containing the vertices of an outline that was created in the editor or by script. .. rst-class:: classref-item-separator ---- .. _class_NavigationPolygon_method_get_outline_count: .. rst-class:: classref-method :ref:`int` **get_outline_count**\ (\ ) |const| :ref:`🔗` Returns the number of outlines that were created in the editor or by script. .. rst-class:: classref-item-separator ---- .. _class_NavigationPolygon_method_get_parsed_collision_mask_value: .. rst-class:: classref-method :ref:`bool` **get_parsed_collision_mask_value**\ (\ layer_number\: :ref:`int`\ ) |const| :ref:`🔗` Returns whether or not the specified layer of the :ref:`parsed_collision_mask` is enabled, given a ``layer_number`` between 1 and 32. .. rst-class:: classref-item-separator ---- .. _class_NavigationPolygon_method_get_polygon: .. rst-class:: classref-method :ref:`PackedInt32Array` **get_polygon**\ (\ idx\: :ref:`int`\ ) :ref:`🔗` Returns a :ref:`PackedInt32Array` containing the indices of the vertices of a created polygon. .. rst-class:: classref-item-separator ---- .. _class_NavigationPolygon_method_get_polygon_count: .. rst-class:: classref-method :ref:`int` **get_polygon_count**\ (\ ) |const| :ref:`🔗` Returns the count of all polygons. .. rst-class:: classref-item-separator ---- .. _class_NavigationPolygon_method_get_vertices: .. rst-class:: classref-method :ref:`PackedVector2Array` **get_vertices**\ (\ ) |const| :ref:`🔗` Returns a :ref:`PackedVector2Array` containing all the vertices being used to create the polygons. .. rst-class:: classref-item-separator ---- .. _class_NavigationPolygon_method_make_polygons_from_outlines: .. rst-class:: classref-method |void| **make_polygons_from_outlines**\ (\ ) :ref:`🔗` **Deprecated:** Use :ref:`NavigationServer2D.parse_source_geometry_data` and :ref:`NavigationServer2D.bake_from_source_geometry_data` instead. Creates polygons from the outlines added in the editor or by script. .. rst-class:: classref-item-separator ---- .. _class_NavigationPolygon_method_remove_outline: .. rst-class:: classref-method |void| **remove_outline**\ (\ idx\: :ref:`int`\ ) :ref:`🔗` Removes an outline created in the editor or by script. You have to call :ref:`make_polygons_from_outlines` for the polygons to update. .. rst-class:: classref-item-separator ---- .. _class_NavigationPolygon_method_set_outline: .. rst-class:: classref-method |void| **set_outline**\ (\ idx\: :ref:`int`, outline\: :ref:`PackedVector2Array`\ ) :ref:`🔗` Changes an outline created in the editor or by script. You have to call :ref:`make_polygons_from_outlines` for the polygons to update. .. rst-class:: classref-item-separator ---- .. _class_NavigationPolygon_method_set_parsed_collision_mask_value: .. rst-class:: classref-method |void| **set_parsed_collision_mask_value**\ (\ layer_number\: :ref:`int`, value\: :ref:`bool`\ ) :ref:`🔗` Based on ``value``, enables or disables the specified layer in the :ref:`parsed_collision_mask`, given a ``layer_number`` between 1 and 32. .. rst-class:: classref-item-separator ---- .. _class_NavigationPolygon_method_set_vertices: .. rst-class:: classref-method |void| **set_vertices**\ (\ vertices\: :ref:`PackedVector2Array`\ ) :ref:`🔗` Sets the vertices that can be then indexed to create polygons with the :ref:`add_polygon` method. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)` .. |void| replace:: :abbr:`void (No return value.)`