unity-animation
O que ela faz
Esta skill explica como controlar a animação de personagens na Unity usando Animator Controllers. Ela é para desenvolvedores que animam personagens com rigging na Unity 6.
Quando usar
- ✓Quando você precisa conectar animações de andar, correr e pular em uma máquina de estados na Unity.
- ✓Quando você quer trocar animações por script usando parâmetros.
- ✓Quando você quer que uma ação do tronco toque por cima do movimento, ou que pés e mãos se ajustem ao chão.
Link da skill
https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/unity/unity-animation/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 meu personagem da Unity trocar de parado para andando e depois correndo, conforme a velocidade com que se move.”
5 skills novas por semana. 1 minuto de leitura.
Como funciona
Ela explica como criar estados e transições com parâmetros, misturar animações com blend trees, sobrepor ações e definir valores por script, para que a máquina de estados escolha a animação certa.
Conteúdo técnico (SKILL.md original)
Texto original do autor, em inglês, direto do GitHub.
Unity Animation (Animator / Mecanim)
Control animation state with Unity 6.3 LTS's Animator and Animator Controllers: parameters,
transitions, blend trees, layers, and humanoid IK. Targets Unity 6.3 LTS (6000.3).
When to use
- Use when connecting animation clips into a state machine, driving them from script via parameters, blending locomotion (idle→walk→run), layering an upper-body action over movement, or adding foot/hand IK on a humanoid rig.
- Use when the project has
*.controller(Animator Controller) and*.animassets, or a rigged model with an Avatar.
When not to use: simple non-skeletal value tweens (UI fades, position lerps) are better
done with a tween/coroutine — see unity-csharp-scripting. Timeline cutscenes are a separate
tool. 2D sprite frame animation also uses the Animator but with sprite keyframes.
Core workflow
- Add an
Animatorto the model and assign an Animator Controller; for a humanoid model, set its rig to Humanoid so it has an Avatar (enables retargeting and IK). - Define parameters on the controller —
Float(Speed),Bool(IsGrounded),Int,Trigger(Jump) — and states with transitions whose conditions read those parameters. - Set parameters from script, never poke states directly:
SetFloat,SetBool,SetInteger,SetTrigger. The state machine resolves transitions for you. - Blend continuous motion with a Blend Tree (one
Floatlike Speed drives idle↔walk↔run) instead of many discrete states + transitions. - Layer additive/override motion (e.g. an upper-body "aim" layer with an Avatar Mask) and
control its
layerWeight. - Verify in the Animator window during Play mode — the live state highlights and parameter values update, so you can see exactly which transition fired (or didn't).
Patterns
1. Drive locomotion + a one-shot action from script
using UnityEngine;
[RequireComponent(typeof(Animator))]
public class CharacterAnim : MonoBehaviour
{
private Animator _anim;
// Cache parameter hashes — faster and typo-proof vs string lookups every frame.
private static readonly int Speed = Animator.StringToHash("Speed");
private static readonly int IsGrounded= Animator.StringToHash("IsGrounded");
private static readonly int Jump = Animator.StringToHash("Jump");
private void Awake() => _anim = GetComponent<Animator>();
public void Tick(float planarSpeed, bool grounded)
{
_anim.SetFloat(Speed, planarSpeed); // drives a 1D blend tree (idle/walk/run)
_anim.SetBool(IsGrounded, grounded); // gates a falling/landing transition
}
public void DoJump() => _anim.SetTrigger(Jump); // fire-and-forget; auto-resets after use
}
2. Smooth a noisy input into a blend parameter
// dampTime smooths Speed so the blend tree doesn't snap; great for analog sticks.
_anim.SetFloat(Speed, targetSpeed, 0.1f /* dampTime */, Time.deltaTime);
3. Play / cross-fade a state directly (bypassing parameter conditions)
// Useful for hit reactions where you want an immediate, explicit transition.
_anim.CrossFade("Hit", 0.1f); // 0.1 = 10% of the state's length, not seconds
_anim.CrossFadeInFixedTime("Hit", 0.15f); // duration in seconds
// Or jump instantly: _anim.Play("Hit");
4. Wait until the current state finishes
private System.Collections.IEnumerator AfterAttack()
{
yield return null; // let the Animator start the transition
// During a transition the "current" state is the one being left; read the next one.
var info = _anim.IsInTransition(0)
? _anim.GetNextAnimatorStateInfo(0)
: _anim.GetCurrentAnimatorStateInfo(0); // layer 0
yield return new WaitForSeconds(info.length); // seconds; approximate, varies in blend trees
// ...follow-up logic
}
Pitfalls
SetTriggermissed or "sticks" — triggers are consumed by the next satisfied transition and auto-reset; if no transition consumes it, it can fire later unexpectedly. UseResetTriggerto clear, or prefer aBoolwhen the condition is a sustained state.- String parameter typos fail silently — a misspelled name just does nothing. Use
Animator.StringToHashand cache the int hashes. - Transition feels laggy —
Has Exit Timemakes the transition wait for the clip to reach a normalized time. Un
Perguntas frequentes
Devo trocar os estados de animação diretamente pelo código?
Não. A skill diz para definir os parâmetros pelo código e deixar a máquina de estados decidir as transições.
O que é um Avatar na Unity?
Um Avatar é a configuração que permite que um modelo humanoide reutilize animações e use cinemática inversa.
Isso cobre transições simples de interface?
Não. Elas são melhor feitas com um tween ou uma corrotina, coberta por uma skill de scripting.
Detalhes
Descrição original do autor
Drive Unity 6.3 LTS character animation with Animator Controllers: states, transitions, parameters, blend trees, animation layers, and humanoid Avatar IK. Use when wiring an Animator, setting parameters from script (SetFloat/SetBool/SetTrigger), building blend trees, or when the user mentions Animator, Mecanim, state machine, blend tree, or .controller.
Popularidade
- Estrelas no GitHub
- 6,6 mil
- Posição no ranking
- #13844
- 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.