#Don't quite understand Navigation behavior

1 messages · Page 1 of 1 (latest)

dark wren
#

I set my NavRegion3D to have an agent radius of 0.5 and I have a capsule mesh with a radius if 0.5. The capsule directly follows its 'get_next_path_position' path, but the mesh still clips through the walls where I would expect it to avoid them as the agent radius and mesh capsule radius are equal. Could someone explain this behavior?

pulsar halo
#

the navigation agent has a path desired distance. If it gets within that distance to the next path point it goes to the next point. If that distance is set too large it will skip corners, if it is too small for the agent speed it will get stuck on points. You need to adjust that to your actor behavior and layout.

#

also if you use a physics node for your character, physics is a stepped process with margins and velocity drag with its movement, so having the same size is often not enough to avoid collision and you need to bake the navmesh with a bigger agent radius to avoid most issues caused by physics behavior.

dark wren
dark wren
#

Changing cell size also helped. Got radius 0.5 working by slightly tweaking cell size

pulsar halo
#

cell size increases the voxel count, so you get more detailed quality for (very) slow bake times. That might work when your levels are small and you only bake in the editor. For runtime changes and rebakes you want to have the highest cell size that still works for your project to improve rebake speed.

#

changing the path desired distance has no downside for performance, the agent checks the distance on each update no matter what.

dark wren
dark wren
#

Id assume max error isn't something that would effect bake times much, no?

pulsar halo
#

max error is a postprocessing of the baking, it is used after the source geometry got already rasterized in the voxel grid to define the edges of the final navmesh. When the error margin is very low it will follow the voxel contours more closely and do some extra computations. With a high error margin it can skip some calculation loops a little earlier and be slightly faster. The error margin is mostly about quality as it avoids having a lot of extra edges added by small voxel cells that are just a single cell offset from a very long edge.