Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Nizil |
I trying use navigation2d.get_simple path
and navigation2DServer.map_get_path
and it returns empty array.
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Nizil |
I trying use navigation2d.get_simple path
and navigation2DServer.map_get_path
and it returns empty array.
Reply From: | smix8 |
Both will return empty when you a) have no navigation mesh on the map b) you are calling the functions to early before the NavigationServer had time to sync, e.g. you are calling in a _ready() function while half the SceneTree is not even done loading. The NavigationServer syncs map changes on the physics frame so you need to at least wait one physics frame before you can query a path.