unity-navmesh
O que ela faz
Esta skill mostra como fazer personagens andarem ao redor de obstáculos na Unity usando uma malha de navegação (navmesh). Ela é para desenvolvedores que fazem inimigos perseguirem jogadores ou guardas patrulharem.
Quando usar
- ✓Quando você quer que um inimigo persiga o jogador ao redor das paredes na Unity.
- ✓Quando você precisa gerar uma superfície caminhável para personagens em uma cena da Unity.
- ✓Quando obstáculos como caixas ou portas devem bloquear ou mudar o caminho durante a partida.
Link da skill
https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/unity/unity-navmesh/SKILL.mdCopie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.
Como usar
O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.
Mensagem pronta para colar
Para Claude Code, Codex ou Cursor: rode na pasta do projeto e a skill fica instalada.
Baixe o SKILL.md e coloque na pasta de skills do seu agente.
Exemplo do que pedir para a IA
“Faça o guarda do meu nível na Unity andar até a posição do jogador evitando as paredes.”
5 skills novas por semana. 1 minuto de leitura.
Como funciona
Ela explica como adicionar um componente de superfície de navegação ao nível, gerá-la (bake) e enviar os agentes para um destino, além de usar componentes de obstáculo para objetos que se movem.
Conteúdo técnico (SKILL.md original)
Texto original do autor, em inglês, direto do GitHub.
Unity NavMesh (AI Navigation)
Give NPCs pathfinding in Unity 6.3 LTS: bake walkable surfaces and move agents around obstacles. Targets Unity 6.3 LTS (6000.3) with the AI Navigation package 2.0 (2.0.16 at last check).
Version trap (Unity 2022+/6): the old built-in Navigation window (Object/Bake tabs, "Navigation Static" flag) is gone. The package's Window → AI → Navigation only holds the Agents and Areas tabs. 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. Agent types (radius, height, step, slope) are defined in Window → AI → Navigation → Agents. - 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.
5. Connect separate mesh pieces with a NavMeshLink (jumps, doors, gaps)
// Two baked surfaces that don't touch (a ledge and the floor below, two platforms across a
// gap) are separate islands — an agent can't path between them. Add Component > Navigation >
// NavMesh Link to bridge them: assign Start/End Transforms, set Width (0 = point-to-point),
// and toggle Bidirectional for one-way vs two-way. NavMeshLink lives in Unity.AI.Navigation.
// It replaces the deprecated built-in OffMeshLink (see pitfalls).
Pitfalls
- **Looking for the Bake tab or the Naviga
Perguntas frequentes
Por que preciso gerar a superfície?
A geração informa à Unity quais áreas são caminháveis, para que os agentes saibam onde podem ir.
Isso decide quando um inimigo deve perseguir?
Não. A lógica de decisão é coberta por uma skill separada de IA de jogo, enquanto esta cuida do movimento.
Funciona com a antiga janela Navigation?
A skill observa que a janela antiga não existe mais, e a geração agora usa um componente do pacote AI Navigation.
Detalhes
Descrição original do autor
Add AI navigation in Unity 6.3 LTS: bake a NavMesh with the AI Navigation package (NavMeshSurface), 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.
Popularidade
- Estrelas no GitHub
- 6,6 mil
- Posição no ranking
- #13848
- Licença
- Apache-2.0
- Atualizada em
- 28/10/2026
Comentários
- …
Mais skills deste repositório
router
6,6 milAjuda seu agente a escolher a skill certa de desenvolvimento de jogos para cada pedido, detectando sua engine e o tipo de tarefa que você precisa.
ai-behavior-trees-utility-ai
6,6 milAjuda seu agente a criar uma árvore de comportamento e um sistema de IA por utilidade para inimigos e personagens que escolhem ações por prioridade e pontuação.
audio-design
6,6 milEnsina seu agente a fazer a mixagem de áudio de jogos: barramentos, volume em decibéis, redução de volume sob diálogos, música adaptativa e variação de efeitos sonoros.
camera-systems
6,6 milAjuda seu agente a criar câmeras de jogo que seguem o personagem com suavidade, ficam dentro da fase e giram ou olham ao redor em 3D.
Skills parecidas
diffs
394 milPermite que seu agente gere um diff real e compartilhável das edições, como link de visualização ou arquivo de imagem, em vez de um resumo escrito à mão.
coding-agent
394 milAjuda seu agente a passar um trabalho grande de programação para o Codex, Claude Code ou OpenCode em segundo plano e acompanhar o andamento.
gh-issues
394 milAjuda seu agente a encontrar issues do GitHub, escolher quais resolver e abrir pull requests com correções, acompanhando os comentários de revisão.