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

Fix "Navigation map synchronization error" when using NavigationRegion2D #83568

Merged
merged 1 commit into from
Oct 18, 2023

Conversation

mrTag
Copy link
Contributor

@mrTag mrTag commented Oct 18, 2023

The constructor of NavigationPolygon instantiates its navigation_mesh variable, preventing the NavigationPolygon::get_navigation_mesh() function from initializing the navigation_mesh object correctly, leading to this error:

modules/navigation/nav_region.cpp:128 - Navigation map synchronization error. Attempted to update a navigation region with a navigation mesh that uses a `cell_size` of 1 while assigned to a navigation map set to a `cell_size` of 0.25. The cell size for navigation maps can be changed by using the NavigationServer map_set_cell_size() function. The cell size for default navigation maps can also be changed in the ProjectSettings.

The instantiation of navigation_mesh in the constructor is not even needed, since that variable is only accessed through NavigationPolygon::get_navigation_mesh() where navigation_mesh is instantiated lazily, if necessary.

fixes #83570

@smix8
Copy link
Contributor

smix8 commented Oct 18, 2023

Indeed, the navigation mesh init in the constructor is a leftover from the future (branch) that slipped in.

@smix8 smix8 added this to the 4.2 milestone Oct 18, 2023
@mrTag mrTag marked this pull request as ready for review October 18, 2023 19:44
@akien-mga akien-mga merged commit f8818f8 into godotengine:master Oct 18, 2023
15 checks passed
@akien-mga
Copy link
Member

Thanks!

@mrTag mrTag deleted the navigationregion2d_fix branch October 19, 2023 07:55
@akien-mga akien-mga changed the title Fixing "Navigation map synchronization error" when using NavigationRegion2D Fix "Navigation map synchronization error" when using NavigationRegion2D Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants