> move agents with NavMeshAgent.SetDestination, and handle dynamic obstacles. Use when setting up pathfinding, making an enemy chase the player, baking navigation, or when the user mentions NavMesh, NavMeshAgent, NavMeshSurface, NavMeshObstacle, or Unity pathfinding.
npx skills add https://github.com/gamedev-skills/awesome-gamedev-agent-skills --skill unity-navmesh
Give NPCs pathfinding in Unity 6: bake walkable surfaces and move agents around obstacles.
Targets Unity 6 (6000.0 LTS) with the AI Navigation package 2.x.
> Version trap (Unity 2022+/6): the old built-in Navigation window (Object/Bake tabs)
> is gone. Baking is now component-based via the AI Navigation package
> (com.unity.ai.navigation): add a NavMeshSurface to your level geometry and click
> Bake. The *runtime* NavMeshAgent/NavMesh API stays in built-in UnityEngine.AI.
adding dynamic blockers (NavMeshObstacle), or checking whether a destination is reachable.
NavMeshSurface component, or scriptsusing UnityEngine.AI.NavMeshAgent.
When *not* to use: the *decision* logic of when/where to move (FSMs, behaviour trees,
steering) → game-ai (this skill is the Unity movement/pathing mechanism). Force-driven or
kinematic movement that isn't pathfinding → unity-physics.
com.unity.ai.navigation).Surface, set the agent type/area settings, and click Bake**. Re-bake whenever geometry,
NavMeshModifiers, or agent settings change.
NavMeshAgent to each moving NPC; its radius/height/speed must match the bakedagent type, and it must spawn *on* the baked mesh.
SetDestination(targetPos); the agent steers and avoids otheragents automatically. Detect arrival with remainingDistance/pathPending.
NavMeshObstacle (carving) so closed doors/crates blockpaths without a full re-bake.
watching agents path around obstacles to the goal; check NavMeshPath.status for
unreachable targets.
using UnityEngine;
using UnityEngine.AI;
[RequireComponent(typeof(NavMeshAgent))]
public class Chaser : MonoBehaviour
{
[SerializeField] private Transform target;
private NavMeshAgent _agent;
private void Awake() => _agent = GetComponent<NavMeshAgent>();
private void Update()
{
if (target) _agent.SetDestination(target.position); // re-path toward the target
}
// Arrived? pathPending guards the first frame before a path exists.
private bool HasArrived() =>
!_agent.pathPending && _agent.remainingDistance <= _agent.stoppingDistance;
}
using UnityEngine.AI;
public bool CanReach(NavMeshAgent agent, Vector3 destination)
{
var path = new NavMeshPath();
agent.CalculatePath(destination, path);
return path.status == NavMeshPathStatus.PathComplete; // vs Partial / Invalid
}
using Unity.AI.Navigation; // the package namespace (NavMeshSurface)
[SerializeField] private NavMeshSurface surface;
// After spawning level geometry, build the navmesh in code.
public void RebuildNav() => surface.BuildNavMesh();
// Add a NavMeshObstacle (Carve = true) to a door/crate. While present it cuts a hole in the
// navmesh so agents route around it; remove/disable it to reopen the path — no re-bake needed.
package's NavMeshSurface component + Bake.
baked. Bake the surface and spawn the agent on it (NavMesh.SamplePosition to snap).
NavMeshObstacle (carving) or a surface.BuildNavMesh() re-bake.
SetDestination every frame is wasteful — for a slow-moving target, re-path on a timer(e.g. every 0.2s) instead of each frame.
NavMeshAgent's size differs from the baked agenttype, it gets stuck in gaps or floats; keep them consistent.
avoidancePriority and quality, or use anobstacle for truly static blockers rather than relying on agent avoidance.
(https://docs.unity3d.com/Packages/[email protected]/manual/index.html) and
ScriptReference/AI.NavMeshAgent, ScriptReference/AI.NavMesh.
game-ai — engine-agnostic decision-making (FSM, behaviour trees, steering) that *uses* this.unity-csharp-scripting — the MonoBehaviour structure around the agent.tower-defense / fps-shooter — genres that compose pathfinding with gameplay.Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
Replace with description of the skill and when Claude should use it.
Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill content", or needs guidance on skill structure, progressive disclosure, or skill development best practices for Claude Code plugins.
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
Use when creating new skills, editing existing skills, or verifying skills work before deployment
Take gamedev-skills/unity-navmesh from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.