All skills
thedivergentai avatar

/godot-animation-player

@9d6e91e

Expert patterns for AnimationPlayer including track types (Value, Method, Audio, Bezier), root motion extraction, animation callbacks, procedural animation generation, call mode optimization, and RESET tracks. Use for timeline-based animations, cutscenes, or UI transitions. Trigger keywords: AnimationPlayer, Animation, track_insert_key, root_motion, animation_finished, RESET_track, call_mode, animation_set_next, queue, blend_times.

Use this Skill: https://skilld.dev/gh/thedivergentai/gd-agentic-skills/godot-animation-player

This session only. Nothing lands on disk.

SKILL.md

β‰ˆ115 tokens always: the name and description. β‰ˆ2.7k when used: this file. β‰ˆ2.4k more on demand in 4 files.

AnimationPlayer

Timeline-based keyframe animation: track choice, RESET, root motion, libraries β€” scripts own recipes.

NEVER Do

  • NEVER forget RESET tracks β€” Animated properties otherwise stick across scene changes.
  • NEVER use Animation.CALL_MODE_CONTINUOUS for one-shot logic β€” Use CALL_MODE_DISCRETE.
  • NEVER animate embedded resource properties directly β€” Prefer instance uniforms / owned materials.
  • NEVER use animation_finished for looping clips β€” Use animation_looped or poll current_animation.
  • NEVER hardcode animation name strings at scale β€” Constants / StringName.
  • NEVER seek() without update=true when same-frame reads matter.
  • NEVER leave off-screen visual-only players active β€” Cull with notifiers.
  • NEVER mutate a playing AnimationLibrary β€” Stop / wait for finished first.
  • NEVER rely on speed_scale for long sync β€” Prefer seek() against a shared clock.

Available Scripts (MANDATORY triggers)

Open the matching script before implementing that pattern. Deep recipes: track-authoring.md, root-motion-and-sequences.md, edge-cases.md.

Need Script
Method-track hit/state keys method_track_logic.gd
Stance/weapon library swap runtime_anim_lib_swapper.gd
Shader uniform timelines dynamic_shader_animation.gd
Runtime track tweak procedural_track_modifier.gd
Forced RESET orchestration reset_track_orchestrator.gd
Bezier β†’ procedural drive bezier_curve_extraction.gd
Off-screen active cull active_animation_culler.gd
Root motion ↔ physics root_motion_physics_sync.gd
Part/equipment tracks character_part_swapper_tracks.gd
TYPE_AUDIO footstep sync precise_audio_sync.gd
Queue/branch sequences animation_sequencer.gd
Code-built Animation resources programmatic_anim.gd
Alt audio-track setup notes audio_sync_tracks.gd

Critical WHY (keep in body)

  • CALL_MODE_CONTINUOUS invokes the method every frame across the key span β€” one-shot hitboxes/VFX need CALL_MODE_DISCRETE.
  • Animating embedded sub-resource properties (e.g. material.albedo_color) duplicates resources into the scene β€” use instanced materials / shader_parameter/* tracks.
  • animation_finished does not fire on looping clips β€” use animation_looped or poll current_animation.
  • Mutating a playing AnimationLibrary crashes or leaves bad transforms β€” stop or await finished before swap.
  • speed_scale drifts for rhythm/multiplayer β€” shared-clock seek(t, true) for long sync.

Track decision matrix

Track Use when Avoid when
Value Animate properties (pos, modulate, uniforms) One-off runtime juice β†’ Tween
Method Hitboxes, SFX hooks, state flips at timestamps CONTINUOUS call mode / missing method on path
Audio Footsteps / VO locked to frames Loose AudioStreamPlayer.play() drift
Bezier Custom easing curves sampled at runtime Simple linear fades

Track authoring samples β†’ track-authoring.md.

Root motion (physics)

CharacterBody3D + Skeleton3D + AnimationPlayer: extract with get_root_motion_position() / rotation on the physics tick β€” root_motion_physics_sync.gd. Walk cycles that only move bones leave the body collider behind.

Sequences, blends, RESET

  • Chain: animation_set_next / queue / animation_sequencer.gd.
  • Blend times for walk↔run polish; play("run", -1, 1.0, 0.5) or set_default_blend_time.
  • Always author a RESET clip with defaults; enable Reset on Save when editing.
  • Reverse playback: play("clip", -1, -1.0) for doors/cinematic rewind.

Full recipes β†’ root-motion-and-sequences.md.

AnimationPlayer vs Tween

Need Prefer
Timeline / many properties / reusable AnimationPlayer
One-shot runtime / interruptible Tween (godot-tweening)

Expert architecture (scripts)

Pattern Script WHY
Shared humanoid libraries runtime_anim_lib_swapper.gd One library, many models β€” play lib/clip
Decoupled timeline events method_track_logic.gd Method track β†’ signaler β†’ gameplay listeners
Off-screen CPU budget active_animation_culler.gd active = false or manual advance()
Code-built clips programmatic_anim.gd Dynamic targets not in FBX

Reference

Progressive disclosure: open Official Documentation links only when researching a specific API; load Related Skills when routing work to a peer domain β€” do not preload the whole lattice.

Official Documentation

  • Introduction to the animation features β€” When AnimationPlayer owns timelines vs Tweens/sprites, and how libraries, RESET, and the editor fit together.
  • Animation track types β€” Value, Method, Bezier, and Audio tracks plus call-mode and keying rules this skill’s patterns depend on.
  • AnimationPlayer β€” play/queue/seek, blend times, animation_finished vs animation_looped, and active culling.
  • Animation β€” Track APIs (track_insert_key, call modes, audio/bezier helpers) and length/loop metadata.
  • AnimationLibrary β€” Shared stance/weapon clip packs added via add_animation_library without duplicating tracks per model.
  • AnimationMixer β€” Root-motion getters, callback process modes, and advance() used by physics sync and budget managers.
  • Using AnimationTree β€” When blends/state machines should drive an underlying AnimationPlayer instead of manual queue.
  • Tween β€” Runtime one-shot motion counterpart for the AnimationPlayer-vs-Tween decision matrix.
  • Adding animations (Your first 3D game) β€” Practical import β†’ AnimationPlayer play loop before advanced track authoring.
  • VisibleOnScreenNotifier3D β€” Screen enter/exit signals used to toggle AnimationPlayer.active for off-screen CPU savings.

Related Skills

Prerequisites
  • godot-signal-architecture β€” Safe animation_finished / animation_looped / custom method-track signaling without lifecycle leaks.
  • godot-resource-data-patterns β€” Shared .tres AnimationLibrary ownership so runtime swaps do not duplicate or mutate playing resources unsafely.
  • godot-gdscript-mastery β€” Typed programmatic track generation, path strings, and Dictionary method-track payloads.
Complements
  • godot-animation-tree-mastery β€” Blend trees, OneShot layers, and travel() when locomotion outgrows AnimationPlayer queue/set_next.
  • godot-2d-animation β€” AnimatedSprite2D / Skeleton2D presentation that still relies on AnimationPlayer method and property tracks.
  • godot-tweening β€” Interruptible runtime tweens when baking a full Animation resource would be overkill.
  • godot-shaders-basics β€” ShaderMaterial uniforms driven by value tracks (shader_parameter/*) without embedding materials.
  • godot-audio-systems β€” Bus/voice pooling around TYPE_AUDIO tracks and footstep/SFX timing on the timeline.
  • godot-physics-3d β€” CharacterBody3D integration for root-motion position/rotation extraction on the physics tick.
Downstream / consumers
  • godot-genre-fighting β€” Frame-perfect hitbox windows and discrete method tracks for cancel windows.
  • godot-genre-platformer β€” Jump/land/run clips, RESET hygiene, and blend times on 2D/3D movers.
  • godot-combat-system β€” Attack timelines that emit damage/VFX events from AnimationPlayer method tracks.
Master
  • godot-master β€” Library router and mirrored module entry for cross-skill discovery.

Source: SKILL.md on GitHub

No alerts16d4 checks Β· Risk SAFE
  • Gen Agent Trust Hub16d

    The skill provides a comprehensive set of Godot GDScript patterns for managing AnimationPlayer, including sequencing, library swapping, and root motion sync. Analysis shows the skill follows standard Godot development practices and uses official/trusted sources for documentation.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW Β· No issues

  • Runlayer7mo

    2/4 files flagged

Signed by skilld at 9d6e91e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 weeks ago.

Activeupdated 2 months ago

README badge

README badge for thedivergentai/gd-agentic-skills/godot-animation-player