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.
This commit is contained in:
parent
e33f8df9ca
commit
67cf622935
2 changed files with 4 additions and 4 deletions
|
@ -41,10 +41,10 @@
|
|||
</method>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="cell_size" type="float" setter="set_cell_size" getter="get_cell_size" default="10.0">
|
||||
<member name="cell_size" type="float" setter="set_cell_size" getter="get_cell_size" default="1.0">
|
||||
The XY plane cell size to use for fields.
|
||||
</member>
|
||||
<member name="edge_connection_margin" type="float" setter="set_edge_connection_margin" getter="get_edge_connection_margin" default="100.0">
|
||||
<member name="edge_connection_margin" type="float" setter="set_edge_connection_margin" getter="get_edge_connection_margin" default="1.0">
|
||||
This value is used to detect the near edges to connect compatible regions.
|
||||
</member>
|
||||
</members>
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue