Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set default cell_size on new TileMap Layer navigation layer maps #79485

Merged
merged 1 commit into from
Jul 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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