navigation-agent-set-destination

Set a NavMeshAgent destination so it pathfinds toward a world-space point in Unity.

Updated May 20, 2026
One-click install
npx skills add https://github.com/Alltwice/Unity-3D-Project --skill navigation-agent-set-destination-alltwice
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: navigation-agent-set-destination
Source: https://github.com/Alltwice/Unity-3D-Project/tree/main/.agents/skills/navigation-agent-set-destination
Command: npx skills add https://github.com/Alltwice/Unity-3D-Project --skill navigation-agent-set-destination-alltwice

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires unity-mcp-cli.

What problem does it solve? Moving AI characters in Unity requires assigning a destination to a NavMeshAgent, which involves resolving GameObject references, handling off-NavMesh states, and verifying path computation. This Skill performs that operation through a single tool call without writing editor scripts. ## Core Features & Use Cases - Destination Assignment: Set a world-space Vector3 destination or pass a target GameObject whose position is used instead. - Safe Off-NavMesh Handling: When the agent is not on a baked NavMesh (e.g., in edit mode or before baking), it reports the intended destination without mutating state. - Path State Reporting: Returns accepted, isOnNavMesh, hasPath, and pathPending flags so you can verify navigation status immediately. - Use Case: During play mode testing, command an enemy NPC to chase the player by passing the player GameObject as targetRef, then confirm the path was accepted from the response. ## Quick Start Ask the AI to set the NavMeshAgent on your character GameObject to move toward a specific world position or target GameObject using the navigation-agent-set-destination tool.

Frequently Asked Questions about navigation-agent-set-destination

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set a NavMeshAgent destination in Unity?▼

Call the navigation-agent-set-destination tool with a gameObjectRef pointing to the GameObject hosting the NavMeshAgent and a destination Vector3 in world space. Alternatively, pass a targetRef GameObject whose position is used as the destination.

How to make a Unity AI agent follow a target GameObject?▼

Provide the target GameObject as the targetRef input instead of explicit coordinates. The tool resolves the target's position and calls SetDestination on the NavMeshAgent, which then pathfinds toward it.

Does NavMeshAgent SetDestination work in Unity edit mode?▼

Path computation and movement happen in play mode, but the destination is still assigned in edit mode. If the agent is off the NavMesh, the tool reports the intended destination without mutating state, so the call is always safe.

Why does SetDestination return accepted false in Unity?▼

The accepted flag is false when the agent is not currently on a baked NavMesh, which happens before baking or when the agent is placed outside walkable areas. Check the isOnNavMesh field in the response to confirm placement.

How do I check if a NavMeshAgent has a path in Unity?▼

The tool response includes hasPath and pathPending booleans after calling SetDestination. hasPath indicates a computed path exists, while pathPending means path computation is still in progress.