/tween-animation
Use when implementing tweens — property animation, method tweening, chaining, parallel sequences, easing, and common UI/gameplay motion recipes
$ npx -y skills add jame581/GodotPrompter --skill tween-animation --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/tween-animation
Context preview
The summary Claude sees to decide when to auto-load this skill.
Use when implementing tweens — property animation, method tweening, chaining, parallel sequences, easing, and common UI/gameplay motion recipes
SKILL.md
tween-animation.SKILL.mdname: tween-animation
description: Use when implementing tweens — property animation, method tweening, chaining, parallel sequences, easing, and common UI/gameplay motion recipes
Tweens in Godot 4.3+
All examples target Godot 4.3+ with no deprecated APIs. GDScript is shown first, then C#.
> **Related skills:** **animation-system** for AnimationPlayer/AnimationTree (keyframe-based), **godot-ui** for UI transitions, **shader-basics** for tweening shader parameters, **camera-system** for camera shake and transitions, **math-essentials** for easing curves and interpolation math, **particles-vfx** for code-driven VFX timing and sequencing.
---
1. Core Concepts
Tween vs AnimationPlayer
| Feature | Tween (code-driven) | AnimationPlayer (data-driven) | |-----------------|--------------------------------------------|--------------------------------------------| | Setup | Code only — no editor needed | Animation panel with keyframes | | Best for | Procedural motion, UI transitions, VFX | Complex multi-track, artist-driven clips | | Reusability | Recreated per use — lightweight | Saved as resources, reusable across scenes | | Blending | No — one tween per property at a time | Yes — AnimationTree supports blending | | Method calls | `tween_callback()` at any point | Call Method tracks at keyframed times |
**Rule of thumb:** Use Tweens for one-off procedural animations (fade in, bounce, slide). Use AnimationPlayer for repeating, artist-tuned animations (walk cycle, attack sequence).
Creating a Tween
Tweens are created from any `Node` and auto-bind to it. When the node is freed, the tween stops automatically.
# Creates a tween bound to this node
var tween := create_tween()
tween.tween_property(self, "position", Vector2(400, 300), 1.0)
var tween = CreateTween();
tween.TweenProperty(this, "position", new Vector2(400, 300), 1.0f);
> **Important:** Each call to `create_tween()` creates a new tween. Previous tweens on the same property are **not** automatically killed — they compete. Kill old tweens before creating new ones on the same property if you don't want conflicts.
---
2. Tweener Types
tween_property() — Animate any property
var tween := create_tween()
# Animate position over 0.5 seconds
tween.tween_property($Sprite2D, "position", Vector2(200, 100), 0.5)
# Animate modulate alpha (fade out)
tween.tween_property($Sprite2D, "modulate:a", 0.0, 0.3)
var tween = CreateTween();
tween.TweenProperty(GetNode("Sprite2D"), "position", new Vector2(200, 100), 0.5);
tween.TweenProperty(GetNode("Sprite2D"), "modulate:a", 0.0f, 0.3);**Sub-property access:** Use `:` to target individual components — `"position:x"`, `"modulate:a"`, `"scale:y"`.
tween_callback() — Call a method at a point in the sequence
var tween := create_tween()
tween.tween_property(self, "position", Vector2.ZERO, 0.5)
tween.tween_callback(func(): print("Arrived!"))
tween.tween_callback(queue_free)var tween = CreateTween();
tween.TweenProperty(this, "position", Vector2.Zero, 0.5f);
tween.TweenCallback(Callable.From(() => GD.Print("Arrived!")));
tween.TweenCallback(Callable.From(QueueFree));tween_interval() — Wait/delay between steps
var tween := create_tween()
tween.tween_property(self, "modulate:a", 0.0, 0.3) # fade out
tween.tween_interval(1.0) # wait 1 second
tween.tween_property(self, "modulate:a", 1.0, 0.3) # fade back in
var tween = CreateTween();
tween.TweenProperty(this, "modulate:a", 0.0f, 0.3);
tween.TweenInterval(1.0f);
tween.TweenProperty(this, "modulate:a", 1.0f, 0.3);
tween_method() — Animate a custom method with interpolated values
# Animate a method that receives interpolated float values
func _ready() -> void:
var tween := create_tween()
tween.tween_method(_set_health_bar, 100.0, 0.0, 2.0)
func _set_health_bar(value: float) -> void:
$HealthBar.value = value
$HealthLabel.text = "%d%%" % int(value)public override void _Ready()
{
var tween = CreateTween();
tween.TweenMethod(Callable.From<float>(SetHealthBar), 100.0f, 0.0f, 2.0f);
}
private void SetHealthBar(float value)
{
GetNode<ProgressBar>("HealthBar").Value = value;
GetNode<Label>("HealthLabel").Text = $"{(int)value}%";
}---
3. Sequencing — Chain vs Parallel
Sequential (Default)
By default, tweeners run **sequentially** — each waits for the previous to finish.
var tween := create_tween()
tween.tween_property(self, "position:x", 300.0, 0.5) # Step 1
tween.tween_property(self, "position:y", 200.0, 0.5) # Step 2 (after Step 1)
tween.tween_property(self, "rotation", PI, 0.3) # Step 3 (after Step 2)
Parallel — Run tweeners simultaneously
Option 1: `set_parallel(true)` — All tweeners run at once
var tween := create_tween().set_parallel(true)
tween.tween_property(self, "position", Vector2(300, 200), 0.5)
tween.tween_property(self, "rotation", PI, 0.5)
tween.tween_property(self, "modulate:a", 0.5, 0.5)
var tween = CreateTween().SetParallel(true);
tween.TweenProperty(this, "position", new Vector2(300, 200), 0.5f);
tween.TweenProperty(this, "rotation", Mathf.Pi, 0.5f);
tween.TweenProperty(this, "modulate:a", 0.5f, 0.5f);
Option 2: `chain()` — Switch back to sequential mid-tween
var tween := create_tween().set_parallel(true)
# These two run at the same time
tween.tween_property(self, "position", Vector2(300, 200), 0.5)
tween.tween_property(self, "scale", Vector2(2, 2), 0.5)
# Switch back to sequential for the next step
tween.chain().tween_property(self, "modulate:a", 0.0, 0.3)
tween.tween_callback(queue_free)
var tween = CreateTween().SetParallel(true);
Read more
name: tween-animation description: Use when implementing tweens — property animation, method tweening, chaining, parallel sequences, easing, and common UI/gameplay motion recipes
Tweens in Godot 4.3+
All examples target Godot 4.3+ with no deprecated APIs. GDScript is shown first, then C#.
> **Related skills:** **animation-system** for AnimationPlayer/AnimationTree (keyframe-based), **godot-ui** for UI transitions, **shader-basics** for tweening shader parameters, **camera-system** for camera shake and transitions, **math-essentials** for easing curves and interpolation math, **particles-vfx** for code-driven VFX timing and sequencing.
---
1. Core Concepts
Tween vs AnimationPlayer
| Feature | Tween (code-driven) | AnimationPlayer (data-driven) | |-----------------|--------------------------------------------|--------------------------------------------| | Setup | Code only — no editor needed | Animation panel with keyframes | | Best for | Procedural motion, UI transitions, VFX | Complex multi-track, artist-driven clips | | Reusability | Recreated per use — lightweight | Saved as resources, reusable across scenes | | Blending | No — one tween per property at a time | Yes — AnimationTree supports blending | | Method calls | `tween_callback()` at any point | Call Method tracks at keyframed times |
**Rule of thumb:** Use Tweens for one-off procedural animations (fade in, bounce, slide). Use AnimationPlayer for repeating, artist-tuned animations (walk cycle, attack sequence).
Creating a Tween
Tweens are created from any `Node` and auto-bind to it. When the node is freed, the tween stops automatically.
# Creates a tween bound to this node var tween := create_tween() tween.tween_property(self, "position", Vector2(400, 300), 1.0)
var tween = CreateTween(); tween.TweenProperty(this, "position", new Vector2(400, 300), 1.0f);
> **Important:** Each call to `create_tween()` creates a new tween. Previous tweens on the same property are **not** automatically killed — they compete. Kill old tweens before creating new ones on the same property if you don't want conflicts.
---
2. Tweener Types
tween_property() — Animate any property
var tween := create_tween() # Animate position over 0.5 seconds tween.tween_property($Sprite2D, "position", Vector2(200, 100), 0.5) # Animate modulate alpha (fade out) tween.tween_property($Sprite2D, "modulate:a", 0.0, 0.3)
var tween = CreateTween();
tween.TweenProperty(GetNode("Sprite2D"), "position", new Vector2(200, 100), 0.5);
tween.TweenProperty(GetNode("Sprite2D"), "modulate:a", 0.0f, 0.3);**Sub-property access:** Use `:` to target individual components — `"position:x"`, `"modulate:a"`, `"scale:y"`.
tween_callback() — Call a method at a point in the sequence
var tween := create_tween()
tween.tween_property(self, "position", Vector2.ZERO, 0.5)
tween.tween_callback(func(): print("Arrived!"))
tween.tween_callback(queue_free)var tween = CreateTween();
tween.TweenProperty(this, "position", Vector2.Zero, 0.5f);
tween.TweenCallback(Callable.From(() => GD.Print("Arrived!")));
tween.TweenCallback(Callable.From(QueueFree));tween_interval() — Wait/delay between steps
var tween := create_tween() tween.tween_property(self, "modulate:a", 0.0, 0.3) # fade out tween.tween_interval(1.0) # wait 1 second tween.tween_property(self, "modulate:a", 1.0, 0.3) # fade back in
var tween = CreateTween(); tween.TweenProperty(this, "modulate:a", 0.0f, 0.3); tween.TweenInterval(1.0f); tween.TweenProperty(this, "modulate:a", 1.0f, 0.3);
tween_method() — Animate a custom method with interpolated values
# Animate a method that receives interpolated float values
func _ready() -> void:
var tween := create_tween()
tween.tween_method(_set_health_bar, 100.0, 0.0, 2.0)
func _set_health_bar(value: float) -> void:
$HealthBar.value = value
$HealthLabel.text = "%d%%" % int(value)public override void _Ready()
{
var tween = CreateTween();
tween.TweenMethod(Callable.From<float>(SetHealthBar), 100.0f, 0.0f, 2.0f);
}
private void SetHealthBar(float value)
{
GetNode<ProgressBar>("HealthBar").Value = value;
GetNode<Label>("HealthLabel").Text = $"{(int)value}%";
}---
3. Sequencing — Chain vs Parallel
Sequential (Default)
By default, tweeners run **sequentially** — each waits for the previous to finish.
var tween := create_tween() tween.tween_property(self, "position:x", 300.0, 0.5) # Step 1 tween.tween_property(self, "position:y", 200.0, 0.5) # Step 2 (after Step 1) tween.tween_property(self, "rotation", PI, 0.3) # Step 3 (after Step 2)
Parallel — Run tweeners simultaneously
Option 1: `set_parallel(true)` — All tweeners run at once
var tween := create_tween().set_parallel(true) tween.tween_property(self, "position", Vector2(300, 200), 0.5) tween.tween_property(self, "rotation", PI, 0.5) tween.tween_property(self, "modulate:a", 0.5, 0.5)
var tween = CreateTween().SetParallel(true); tween.TweenProperty(this, "position", new Vector2(300, 200), 0.5f); tween.TweenProperty(this, "rotation", Mathf.Pi, 0.5f); tween.TweenProperty(this, "modulate:a", 0.5f, 0.5f);
Option 2: `chain()` — Switch back to sequential mid-tween
var tween := create_tween().set_parallel(true) # These two run at the same time tween.tween_property(self, "position", Vector2(300, 200), 0.5) tween.tween_property(self, "scale", Vector2(2, 2), 0.5) # Switch back to sequential for the next step tween.chain().tween_property(self, "modulate:a", 0.0, 0.3) tween.tween_callback(queue_free)
var tween = CreateTween().SetParallel(true);
Agentic skills framework for Godot 4.x game development. Gives AI coding agents domain-specific expertise for GDScript and C# projects.
Other skills on godot-prompter.
- /authoring-godot-prompter-skills
Use when writing or editing a SKILL.md or an agent definition in this repo — required frontmatter, section ordering, and the GDScript-then-C# example convention.
Open skill - /releasing-godot-prompter
Use when cutting a GodotPrompter release or bumping its version — the version-bump sequence, tag-triggered workflow, and the marketplace manifests that must follow.
Open skill - /2d-essentials
Use when working with 2D-specific systems — TileMaps, parallax scrolling, 2D lights and shadows, canvas layers, particles 2D, custom drawing, and 2D meshes in Godot 4.3+
Open skill - /3d-essentials
Use when working with 3D-specific systems — materials, lighting, shadows, environment, global illumination, fog, LOD, occlusion culling, and decals in Godot 4.3+
Open skill - /ability-system
Use when building character abilities — Resource-based abilities with cost/cooldown/cast, buffs/debuffs, stat modifiers, gameplay tags, and HUD binding
Open skill - /addon-development
Use when creating Godot editor plugins — EditorPlugin, @tool scripts, custom inspectors, and dock panels
Open skill

