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

MobFollow.gd:69 @ move_toward_target(): Parameter "map" is null. #552

Closed
snipercup opened this issue Dec 9, 2024 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@snipercup
Copy link
Collaborator

I got this error:

E 0:33:32:0047   MobFollow.gd:69 @ move_toward_target(): Parameter "map" is null.
  <C++ Source>   modules/navigation/3d/godot_navigation_server_3d.cpp:1358 @ _query_path()
  <Stack Trace>  MobFollow.gd:69 @ move_toward_target()
                 MobFollow.gd:61 @ Physics_Update()
                 StateMachine.gd:41 @ _physics_process()

It keeps producing it when I was around rocky hill. I was at 13000 errors when I realized. I thought I fixed this long ago, but it's still here. We could fix it by implementing #438 but that's easier said then done. In the meantime we should try to come up with a solution for this error.

It's a technical problem. It sets the current navigation map in this line in MobFollow.gd: var current_chunk = mob.get_chunk_from_position(target_location), but the navigationmap might disappear after it is set. This could happen when the mob is just on the edge of a chunk, which is why it will not happen consistently.

@snipercup snipercup added the bug Something isn't working label Dec 9, 2024
@snipercup
Copy link
Collaborator Author

I got this in the debug output:

Tried to set navigation_map_id at (-416, 320), but it was null. last_position = (-391.9551, 1, 350.6978), last_chunk = (0.1, 0.1)
   At: res://Scripts/Mob/Mob.gd:154:update_navigation_agent_map()

I see this comment:

		# Set the last chunk to one that doesn't exist so it will try to get a new map
		last_chunk = Vector2(0.1,0.1)

But apparently the map wasn't updated for the mob and the last_chunk remained 0.1

Maybe we should clamp the mob position to 1 so that it is as though the mob walks along a grid as far as the navigation is concerned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant