Skip to content

How to tween in Godot 4: create_tween() and tween_property()

By Eduardo Orellana · Updated

Make a tween from the node with create_tween() and animate a property with tween_property(): create_tween().tween_property(self, "position", Vector2(100, 0), 0.25). The Godot 3 Tween node is gone: Tween.new() prints Tween can't be created directly. Use create_tween() method., and interpolate_property() stops with Invalid call. Nonexistent function 'interpolate_property' in base 'Tween'.

AppImage, x86_64. Ubuntu 22.04, Debian 12, Fedora 39 or newer.

Intel or AMD Chromebook, with Linux turned on.

Download for macOSDownload for WindowsDownload for Linux

What Godot is checking

In Godot 4 a Tween is a RefCounted object owned by the SceneTree, not a node. create_tween() on a node makes one bound to that node: it pauses with it and stops when it is freed. The constructor refuses to make one.

A tween starts on its own on the next frame and runs its steps in order; .set_parallel() runs them together. Its finished signal fires when the last step ends.

More on this: Trying to cast a freed object in Godot 4

Reproduce it

A Godot 3 Tween node, in a Godot 4 project.

GDScript
extends Node2D

func _ready():
	var t = Tween.new()
	add_child(t)
	t.interpolate_property(self, "position", Vector2.ZERO, Vector2(100, 0), 1.0)
	t.start()

What Godot 4.7.2 prints

Output
Godot Engine v4.7.2.stable.mono.official.ed1daf0bf - https://godotengine.org

ERROR: Tween can't be created directly. Use create_tween() method.
   at: Tween (scene/animation/tween.cpp:551)
   GDScript backtrace (most recent call first):
       [0] _ready (res://answers/how-to-tween-in-godot-4/repro.gd:4)
ERROR: Required object "rp_child" is null.
   at: add_child (scene/main/node.cpp:1715)
   GDScript backtrace (most recent call first):
       [0] _ready (res://answers/how-to-tween-in-godot-4/repro.gd:5)
SCRIPT ERROR: Invalid call. Nonexistent function 'interpolate_property' in base 'Tween'.
   at: _ready (res://answers/how-to-tween-in-godot-4/repro.gd:6)
   GDScript backtrace (most recent call first):
       [0] _ready (res://answers/how-to-tween-in-godot-4/repro.gd:6)

Fix it

A tween that moves the node 100 px right in a quarter second, eased, then reports.

GDScript
extends Node2D

func _ready() -> void:
	var tween := create_tween()
	tween.tween_property(self, "position", Vector2(100, 0), 0.25).set_trans(Tween.TRANS_QUAD).set_ease(Tween.EASE_OUT)
	await tween.finished
	print("position ", position, " on frame ", Engine.get_process_frames())

What the fixed script prints

Output
Godot Engine v4.7.2.stable.mono.official.ed1daf0bf - https://godotengine.org

position (100.0, 0.0) on frame 15

Run this fix with your agent

Flockbay is the Godot editor with an AI agent built in. Paste this into Flockbay's chat, or into Claude Code or Codex connected to Flockbay over MCP: the agent finds the cause in your project, applies the fix, runs the game headless and reads Godot's output to check it.

Prompt
How to tween in Godot 4: create_tween() and tween_property() Make a tween from the node with create_tween() and animate a property with tween_property(): create_tween().tween_property(self, "position", Vector2(100, 0), 0.25). The Godot 3 Tween node is gone: Tween.new() prints Tween can't be created directly. Use create_tween() method., and interpolate_property() stops with Invalid call. Nonexistent function 'interpolate_property' in base 'Tween'. Where this calls for a change in my Godot 4 project, make it, then run the game headless and check Godot's output for errors.

Several steps, one after another

Each tween_property() call adds a step that starts when the previous one ends. tween_interval() adds a pause and tween_callback() calls a function.

More on this: Quat in Godot 4: it is Quaternion now

GDScript
var tween := create_tween()
tween.tween_property($Sprite2D, "modulate:a", 0.0, 0.5)
tween.tween_callback($Sprite2D.queue_free)

Verified on Godot 4.7.2

Both scripts on this page were run headless on Godot 4.7.2 (4.7.2.stable.mono.official.ed1daf0bf) on 18 October 2026, and the output above is what Godot printed, unedited.

Where the check lives in Godot's source: tween.cpp line 551, the message, Tween in the class reference.

Questions

How do I stop a tween?
Keep the Tween it returned and call kill(). Starting a new tween on the same property does not stop the old one.
Can I tween one axis?
Yes, with a property path: tween_property(self, "position:x", 100.0, 0.25).

Flockbay's agent reads Godot's debugger output and fixes errors like this one in your project, on the official Godot.

Download Flockbay free