godotengine / godotengine/godot

NavigationAgent2D GetCurrentNavigationPath returns empty unless IsNavigationFinished is called directly preceding the call

Open
#104,673 2 comments 0 reactions 0 assignees View on GitHub
discussion documentation topic:navigation
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

-Reproducible in Godot 4.4, using C#

### System information

Windows 11, Godot 4.4

### Issue description

NavigationAgent2D has an issue with side effects. If I set a target position without first calling IsNavigationFinished, GetCurrentNavigationPath will always return an empty path, and the PathChanged signal will never trigger.

### Steps to reproduce

1. Create a NavigationAgent2D with a tilemaplayer with a navigation layer
2. Change NavigationAgent2D target position without calling "IsNavigationFinished()"
3. GetCurrentNavigationPath returns empty, PathChanged signal never triggers

### Minimal reproduction project (MRP)

N/A

Contributor guide

Open the contributing guide

Research direction

Start with the NavigationAgent2D entry points GetCurrentNavigationPath, IsNavigationFinished, the target-position update, and the PathChanged signal. Reproduce the issue in Godot 4.4 using the listed tilemap navigation setup, then trace why the path remains empty without the preceding call; done means the path is returned and PathChanged triggers without calling IsNavigationFinished first.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, godot
Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.