navigationserver map query failed because it was made before first map sync
Asked Answered
S

9

0

Godot 4.1.1

Following my course to a tee but my debugger is spamming 40+ of the same error while in their video the enemy is at least moving around the navmesh. Mine doesn't move at all currently.

The errors are

enemy.gd:28@roamlocation(): navigationserver map query failed because it was made before first map synchronization.
and
enemy.gd:30@roamlocation(): navigationserver map query failed because it was made before first map synchronization.

I tried Googling but did not understand the solutions.

Suffer answered 1/10, 2023 at 11:17 Comment(0)
S
0

Frustratingly unable to make forward progress with instructor or Discord.

So I went to the Godot documentation and made modifications to my instructor's script and managed to reduce the errors from 46 down to 11. https://docs.godotengine.org/en/stable/tutorials/navigation/navigation_using_navigationservers.html

Now I get the same error but it's complaining about line 35 specifically. The enemy also still doesn't want to move.

The cell settings for the navmesh match the project settings cell sizes as well, I don't know what else to do.

Suffer answered 1/10, 2023 at 21:58 Comment(0)
B
0

Suffer You set the target and query if its reachable in the same frame (lines 32, 35). I guess at the time you query for the first time at startup the target is not set because it takes one physics frame for any requested changes to nav server to take effect.

Biparietal answered 1/10, 2023 at 22:21 Comment(0)
S
0

I'm still lost

Suffer answered 1/10, 2023 at 22:25 Comment(0)
B
0

Suffer Can you make a minimal project that reproduces the problem?

Biparietal answered 1/10, 2023 at 22:28 Comment(0)
S
0

Unfortunately, not really, halfway through the course the instructor largely gave up explaining what was being done. I'd just end up having to make the same script and general setup again.

Suffer answered 1/10, 2023 at 22:36 Comment(0)
B
0

Suffer What happens if you put one physics frame await between lines 32 and 35?

Btw you should strive to always be able to reproduce the problem in isolated minimal setting. It's one of the essential problem solving skills in general.

Biparietal answered 1/10, 2023 at 22:38 Comment(0)
S
0

Biparietal

In an ideal scenario my instructor would have taught me what they were doing too so I could understand the script lol

My friend has been assisting and tried rewriting the script based on the documentation

Were currently dealing with a new error that says error on line 29, 1: not all code paths return a value.

Suffer answered 1/10, 2023 at 23:0 Comment(0)
S
0

Fixed that because the function wasn't returning anything. So I told it to just return to the target_location.

Same errors unfortunately

Suffer answered 1/10, 2023 at 23:7 Comment(0)
B
0

Suffer I don't see an await statement between setting the target and checking if it's reached. You just commented out the line that's setting the target. So doing a query without a set target again results in an error.

Do you have a basic understanding of how the nav server timing works, from that description in the docs?

Biparietal answered 2/10, 2023 at 0:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.