Skip to content

Commit

Permalink
Merge pull request #79485 from smix8/tilemap_cell_size_4.x
Browse files Browse the repository at this point in the history
Set default `cell_size` on new TileMap Layer navigation layer maps
  • Loading branch information
YuriSizov committed Jul 24, 2023
2 parents 372e9ab + 671839d commit 6fb5d9e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scene/2d/tile_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,8 @@ void TileMapLayer::_navigation_update() {
uses_world_navigation_map = true;
} else {
RID new_layer_map = NavigationServer2D::get_singleton()->map_create();
// Set the default NavigationPolygon cell_size on the new map as a mismatch causes an error.
NavigationServer2D::get_singleton()->map_set_cell_size(new_layer_map, 1.0);
NavigationServer2D::get_singleton()->map_set_active(new_layer_map, true);
navigation_map = new_layer_map;
uses_world_navigation_map = false;
Expand Down

0 comments on commit 6fb5d9e

Please sign in to comment.