Navigation Agent Help

Godot Version

4.1.1

Question

I want an NPC (Navigation Agent) to walk to the edge and fall down… How do I do this since they only move in the Navigation Region :thinking:


There is a Node3D as a target for walking there, but it outside of the NavRegion so the NPCs stop at the Region’s edge

This is where it would be in the code:

if leave:
		nav_agent.target_position = target[8].global_position
# target is the Node3D's position, you can just leave it as "target" for the explanation :)

Well, when the navigation agent is done and reached the edge, you can just make it walk off “manually”, by setting it’s velocity in that direction.

Or you probably have some code to make the NPC stop (by setting it’s velocity to zero) when the nav agent reached it’s target. You could disable that part of the code when leave is true, so it won’t stop at the edge and walks off.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.