Index of every page on this site: llms.txt
All skills
jame581 avatar

/tween-animation

@426e8ab
by Jan Mesarčjame581/godotprompter979 stars
63
Run it yourself

Use when implementing tweens — property animation, method tweening, chaining, parallel sequences, easing, and common UI/gameplay motion recipes

Use this Skill: https://skilld.dev/gh/jame581/godotprompter/tween-animation

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referenceslifecycle.md

≈468 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Tween Lifecycle

Reference for skills/tween-animation/SKILL.md — kill/replace patterns, pause modes, speed scale, ignore time scale.

← Back to SKILL.md


7. Tween Lifecycle

Killing and Replacing Tweens

var _move_tween: Tween

func move_to(target: Vector2) -> void:
    # Kill the previous tween if still running
    if _move_tween and _move_tween.is_valid():
        _move_tween.kill()

    _move_tween = create_tween()
    _move_tween.set_trans(Tween.TRANS_CUBIC).set_ease(Tween.EASE_OUT)
    _move_tween.tween_property(self, "position", target, 0.4)
private Tween _moveTween;

public void MoveTo(Vector2 target)
{
    if (_moveTween != null && _moveTween.IsValid())
        _moveTween.Kill();

    _moveTween = CreateTween();
    _moveTween.SetTrans(Tween.TransitionType.Cubic).SetEase(Tween.EaseType.Out);
    _moveTween.TweenProperty(this, "position", target, 0.4f);
}

Pause Mode

# Tween continues during SceneTree pause (for pause menu animations)
var tween := create_tween()
tween.set_pause_mode(Tween.TWEEN_PAUSE_PROCESS)

# Tween pauses when bound node's process_mode stops it (default)
tween.set_pause_mode(Tween.TWEEN_PAUSE_BOUND)

Speed Scale

# Slow motion tween (half speed)
var tween := create_tween()
tween.set_speed_scale(0.5)

# Double speed
tween.set_speed_scale(2.0)

Ignore Time Scale (Godot 4.4+)

On 4.3, compensate instead: tween.set_speed_scale(1.0 / Engine.time_scale) while Engine.time_scale > 0 (set it again whenever the time scale changes). At a time scale of 0 (hit-stop) the speed scale would be infinite and the tween's delta becomes NaN, so skip the compensation then.

# Tween runs at normal speed even when Engine.time_scale is changed
var tween := create_tween()
tween.set_ignore_time_scale()

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts29d3 checks · Risk SAFE
  • Gen Agent Trust Hub29d

    This skill provides helpful documentation and code examples for implementing tween animations in the Godot game engine and contains no security risks.

  • Socket29d

    No alerts

  • Snyk29d

    Risk: LOW · No issues

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

Last checked against GitHub 6 days ago.

Activeupdated last month

README badge

README badge for jame581/godotprompter/tween-animation