Skip to content

NavigationServer.map_changed doesn't result in usable map on first iteration. #112652

@pewcworrell

Description

@pewcworrell

Tested versions

4.5
4.5.1.rc
4.6.dev3

System information

Godot v4.5.1.rc (2fc7383e0) - Windows 11 (build 22631) - Multi-window, 3 monitors - Vulkan (Forward+) - dedicated AMD Radeon RX 7900 XT (Advanced Micro Devices, Inc.; 32.0.11037.4004) - AMD Ryzen Threadripper 7970X 32-Cores (64 threads) - 127.5 GiB memory

Issue description

While debugging issues after upgrading from 4.4 -> 4.5, I noticed that our game's spawners were always getting the zero vector when calling NavigationServer3D.map_get_closest_point. This was working in 4.4 when calling NavigationServer3D.map_get_closest_point after the NavigationServer.map_changed signal. In Godot 4.5, that method will return the zero vector until after the second call to NavigationServer.map_changed (at least as far as I can tell). I'm not sure what changed, but I would expect this method to work after the map_changed signal is fired.

Steps to reproduce

Run the sample in 4.4, notice that the call to NavigationServer3D.map_get_closest_point works after first emission of the map_changed signal.

Run the sample in 4.5 onward, and notice that the call to NavigationServer3D.map_get_closest_point doesn't work after first emission of the map_changed signal. It only works after the second emission.

Minimal reproduction project (MRP)

test-navigation-get-closest-point.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions