From 450e29a569b31539cbabd3221f998d2d51bf51ec Mon Sep 17 00:00:00 2001 From: Pawel Lampe Date: Fri, 28 Jan 2022 22:35:05 +0100 Subject: [PATCH] Improve Navigation2D default settings, see #56852 This commit reduces `cell_size` and `edge_connection_margin` default values so that `Navigation2D` behaves more like in Godot <= `3.4` by default. --- doc/classes/ProjectSettings.xml | 4 ++-- scene/resources/world_2d.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index a92afb7ea785..b0d88ebb4c5c 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -1329,10 +1329,10 @@ The policy to use for unhandled Mono (C#) exceptions. The default "Terminate Application" exits the project as soon as an unhandled exception is thrown. "Log Error" logs an error message to the console instead, and will not interrupt the project execution when an unhandled exception is thrown. [b]Note:[/b] The unhandled exception policy is always set to "Log Error" in the editor, which also includes C# [code]tool[/code] scripts running within the editor as well as editor plugin code. - + Default cell size for 2D navigation maps. See [method NavigationServer2D.map_set_cell_size]. - + Default edge connection margin for 2D navigation maps. See [method NavigationServer2D.map_set_edge_connection_margin]. diff --git a/scene/resources/world_2d.cpp b/scene/resources/world_2d.cpp index c937d988d21f..9d8e0f754769 100644 --- a/scene/resources/world_2d.cpp +++ b/scene/resources/world_2d.cpp @@ -83,8 +83,8 @@ World2D::World2D() { // Create and configure the navigation_map to be more friendly with pixels than meters. navigation_map = NavigationServer2D::get_singleton()->map_create(); NavigationServer2D::get_singleton()->map_set_active(navigation_map, true); - NavigationServer2D::get_singleton()->map_set_cell_size(navigation_map, GLOBAL_DEF("navigation/2d/default_cell_size", 10)); - NavigationServer2D::get_singleton()->map_set_edge_connection_margin(navigation_map, GLOBAL_DEF("navigation/2d/default_edge_connection_margin", 5)); + NavigationServer2D::get_singleton()->map_set_cell_size(navigation_map, GLOBAL_DEF("navigation/2d/default_cell_size", 1)); + NavigationServer2D::get_singleton()->map_set_edge_connection_margin(navigation_map, GLOBAL_DEF("navigation/2d/default_edge_connection_margin", 1)); } World2D::~World2D() {