NavMesh guidance for tunnels

I’m looking for some NavMesh guidance. My navmesh agents are mutant mice running through a maze. Small mice should have the ability to run through mouse holes, but as they grow huge in size (mutants!), they should lose that option and have to go the long way around.

Right now, I have an empty “Mouse” with my NavMesh agent script attached, and as the mice grow, I’m scaling up Mouse accordingly (my MouseGeo is a child of Mouse). Gameplay Mouse scale goes from 1 to 12. As I scale up Mouse, I can see the NavMesh agent bounding cylinder also scale up.

But when I play, and watch the mice run rampant and grow in size, the large mice are passing through the tiny mouse holes, too. They collide against the walls around the holes – the maze wall is all one big geo – but the small and large mice pass through the mouse hole/tunnels without the larger mice colliding.

What should I be doing differently?

A single NavMesh takes no account of the agent’s size. It’s not like character controllers that limit the size of players through corridors and narrow spaces. Your solution is to create multiple NavMeshes and have different sizes of mouse use their custom NavMesh.