unity-navmesh-sh-59jk2r
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "unity-navmesh-sh-59jk2r" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-d7ff7c2c9756d089793b9cf59414e32a4aff26f9ac14f06abdba643e9a3063c8. Verify the upstream source and version against https://skillhub.cn/skills/user_3c6cb52e/unity-navmesh-sh-59jk2r before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Unity NavMesh–specific skill that helps AI agents efficiently complete tasks related to Unity NavMesh.
Introduction source: third_party · user_3c6cb52e · 1.0.0 Reference
SkillPi interpretation
- Tasks
- 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**.
- Audience
- Use when an agent needs to walk/chase/patrol to a target, when baking a navigable surface, adding dynamic blockers (`NavMeshObstacle`), or checking whether a destination is reachable. Use when the project has the AI Navigation package, a `NavMeshSurface` component, or scripts using `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`.
- Testing
- Not tested
Browse files
Frontmatter
name: Unitynavmesh
slug: unity-navmesh
version: 1.0.0
displayName: Unitynavmesh
description: >
Unitynavmesh专用技能,帮助AI Agent高效完成相关任务。
Unitynavmesh专用技能,帮助AI Agent高效完成相关任务。
summary: "Unitynavmesh专用技能,帮助AI Agent高效完成相关任务。"
license: Apache-2.0
category: 游戏开发
framework:
- Claude Code
- Codex
- Hermes Agent
- OpenClaw
- QClaw
- WorkBuddy
platform: multi-platform
homepage: "https://github.com/1991513ccie-png"
repository: "https://github.com/1991513ccie-png"Unity NavMesh (AI Navigation)
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 runtimeNavMeshAgent/NavMeshAPI stays in built-inUnityEngine.AI.
When to use
- Use when an agent needs to walk/chase/patrol to a target, when baking a navigable surface,
adding dynamic blockers (
NavMeshObstacle), or checking whether a destination is reachable. - Use when the project has the AI Navigation package, a
NavMeshSurfacecomponent, or scripts usingUnityEngine.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.
Core workflow
- Install the AI Navigation package (Package Manager →
com.unity.ai.navigation). - Bake a surface: select the static level geometry, Add Component → Navigation → NavMesh
Surface, set the agent type/area settings, and click Bake. Re-bake whenever geometry,
NavMeshModifiers, or agent settings change. - Add a
NavMeshAgentto each moving NPC; its radius/height/speed must match the baked agent type, and it must spawn on the baked mesh. - Drive it from script with
SetDestination(targetPos); the agent steers and avoids other agents automatically. Detect arrival withremainingDistance/pathPending. - Handle dynamic blockers with
NavMeshObstacle(carving) so closed doors/crates block paths without a full re-bake. - Verify with the AI Navigation overlay (the baked mesh is drawn in the Scene view) and by
watching agents path around obstacles to the goal; check
NavMeshPath.statusfor unreachable targets.
Patterns
1. Chase/seek with a NavMeshAgent
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;
}
2. Check reachability before committing
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
}
3. Bake at runtime (for procedurally built or streamed levels)
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();
4. Dynamic obstacle that carves the mesh
// 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.
Pitfalls
- Looking for the Navigation window — it no longer exists in Unity 6. Use the AI Navigation
package's
NavMeshSurfacecomponent + Bake. - Agent doesn't move / warps to origin — it isn't on the baked mesh, or no surface was
baked. Bake the surface and spawn the agent on it (
NavMesh.SamplePositionto snap). - Agent ignores new geometry — the navmesh is baked; runtime-spawned obstacles need a
NavMeshObstacle(carving) or asurface.BuildNavMesh()re-bake. SetDestinationevery frame is wasteful — for a slow-moving target, re-path on a timer (e.g. every 0.2s) instead of each frame.- Agent radius/height mismatch — if the
NavMeshAgent's size differs from the baked agent type, it gets stuck in gaps or floats; keep them consistent. - Agents jitter against each other — tune
avoidancePriorityand quality, or use an obstacle for truly static blockers rather than relying on agent avoidance.
References
- Primary docs: AI Navigation package manual
(
https://docs.unity3d.com/Packages/com.unity.ai.navigation@2.0/manual/index.html) andScriptReference/AI.NavMeshAgent,ScriptReference/AI.NavMesh.
Related skills
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.
Current listing version
1.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 针对 Unity 6 的 NavMesh 导航系统,提供详细的烘焙流程和脚本示例,解决游戏开发中 NPC 寻路的高频刚需。
- 覆盖了从安装 AI Navigation 包到动态障碍物处理的完整工作流,实用性强。
Areas to improve
-
description内容截断 Reported severity: Major
顶层 frontmatter 的 description 字段内容重复且不完整,未明确说明触发条件,仅在 skill_body 内部有详细描述。
Recommendation: 将完整的触发描述移至顶层 frontmatter 的 description 字段,避免重复和截断,确保用户能快速理解 Skill 的适用场景。
Areas to improve
-
文档过长 Reported severity: Minor
skill_body 文件内容较长,接近或超过 500 行,可能影响阅读体验。
Recommendation: 考虑将部分内容拆分为独立的引用文件(如详细的代码示例或陷阱说明),并在主文件中引用,以控制主文件长度。
Highlights
- 文档结构清晰,包含 Core workflow、Patterns、Pitfalls、References 等完整章节,步骤明确,有代码示例和出口条件。
Highlights
- 提供了具体的包安装指令、组件添加步骤、脚本示例和常见错误处理,工具来源明确,参数正确,覆盖了主要异常场景。
- 包含运行时烘焙、动态障碍物处理和路径可达性检查等关键可靠性保障。
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Domains or addresses referenced in the document
These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.
- docs.unity3d.com
- github.com
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.