Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Game Development How to Make a Video Game Score, Enemies, and Game State Create Enemy Navigation and AI

Charles Voyles
PLUS
Charles Voyles
Courses Plus Student 1,906 Points

Failed to create agent because it is not close enough to the NavMesh

"SetDestination" can only be called on an active agent that has been placed on a NavMesh. UnityEngine.AI.NavMeshAgent:SetDestination(Vector3) BirdMovement:Update() (at Assets/Scripts/BirdMovement.cs:23)

I followed the directions but the NavMesh Agent has an Agent Type where you change the size settings. I have baked the NavMesh and tried removing and then adding the bird again. Still get this error.

1 Answer

Charles Voyles
PLUS
Charles Voyles
Courses Plus Student 1,906 Points

I deleted and reset the Agent Type settings and used the size settings on the new default humanoid Agent Type. Bake the NavMesh again and that seemed to fix the error. This seems like it is a bug in the editor.