Failed to create agent because there is no valid NavMesh

error: unity Failed to create agent because there is no valid NavMesh

warning: Failed to create agent because there is no valid navigation mesh

problem analysis:

reported this error when directing a character to move with a mouse click, because there is no bake environment.

we achieve obstacle avoidance through navigation system. This error occurs when you call the Nav Mesh Agent component directly without a Bake environment.

solution:

open Navigation:

select the terrain we created ourselves:

select Bake in Navigation and click Bake.

Read More: