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

NavigationAgent3D: target_desired_distance works relatively on path_desired_distance #85970

Closed
evilenzo opened this issue Dec 9, 2023 · 5 comments

Comments

@evilenzo
Copy link

evilenzo commented Dec 9, 2023

Tested versions

Reproducible in 4.2

System information

Godot v4.2.stable.mono - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 (NVIDIA; 31.0.15.4617) - AMD Ryzen 7 7800X3D 8-Core Processor (16 Threads)

Issue description

In 3d navigation target desired distance is ignored when path desired distance is greater than it. I don't think these two variables should be in such dependency

Steps to reproduce

See the MRP. We have agent with path desired distance set to 5m and target desired distance set to 1m. But it stops on 5m before the last point (just click left mouse to start moving character to point). Use path debug visuals. You can also try to change path desired distance and see that it affects distance to target on navigation finish

Minimal reproduction project (MRP)

MRP Distance.zip

@evilenzo
Copy link
Author

evilenzo commented Dec 9, 2023

Short version: target desired distance less than path desired distance just doesn't work. It is being ignored. And I don't think anyone expects such behaviour

@evilenzo
Copy link
Author

evilenzo commented Dec 9, 2023

@Calinou no need in testing, I just checked Godot sources.

As we can see you check target_desired_distance here

_check_distance_to_target();

But it is in loop that works with condition that checks path desired distance

while (origin.distance_to(navigation_path[navigation_path_index] - Vector3(0, path_height_offset, 0)) < path_desired_distance) {

@evilenzo
Copy link
Author

evilenzo commented Dec 9, 2023

More than that

emit_signal(SNAME("target_reached"));

This event is never emitted. You will get navigation_finished event, but not target_reached event in that case

@smix8
Copy link
Contributor

smix8 commented Dec 9, 2023

PR #82561

@evilenzo
Copy link
Author

evilenzo commented Dec 9, 2023

Duplicate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants