From 67cf62293596fb89877a55429388c92fa14f308b Mon Sep 17 00:00:00 2001 From: Pawel Lampe Date: Sun, 23 Jan 2022 13:52:15 +0100 Subject: [PATCH] Improve `Navigation2D` default settings, fixes #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/Navigation2D.xml | 4 ++-- scene/2d/navigation_2d.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/classes/Navigation2D.xml b/doc/classes/Navigation2D.xml index ed00a277b3f..54553e4b8be 100644 --- a/doc/classes/Navigation2D.xml +++ b/doc/classes/Navigation2D.xml @@ -41,10 +41,10 @@ - + The XY plane cell size to use for fields. - + This value is used to detect the near edges to connect compatible regions. diff --git a/scene/2d/navigation_2d.cpp b/scene/2d/navigation_2d.cpp index 886541cb1b5..87fe05bce45 100644 --- a/scene/2d/navigation_2d.cpp +++ b/scene/2d/navigation_2d.cpp @@ -84,8 +84,8 @@ RID Navigation2D::get_closest_point_owner(const Vector2 &p_point) const { Navigation2D::Navigation2D() { map = Navigation2DServer::get_singleton()->map_create(); - set_cell_size(10); // Ten pixels - set_edge_connection_margin(100); + set_cell_size(1); // One pixel + set_edge_connection_margin(1); } Navigation2D::~Navigation2D() {