Skip to content
godot-4-migration logo

Godot 4 Migration Guide

godot-4-migration

Specialized guide for migrating Godot 3.x projects to Godot 4 (GDScript 2.0), covering syntax changes, Tweens, and exports.

SKILL.md

Full skill instructions

Godot 4 Migration Guide

Overview

A critical guide for developers transitioning from Godot 3.x to Godot 4. This skill focuses on the major syntax changes in GDScript 2.0, the new Tween system, and export annotation updates.

When to Use This Skill

  • Use when porting a Godot 3 project to Godot 4.
  • Use when encountering syntax errors after upgrading.
  • Use when replacing deprecated nodes (like Tween node vs create_tween).
  • Use when updating export variables to @export annotations.

Key Changes

1. Annotations (@)

Godot 4 uses @ for keywords that modify behavior.

  • export var x -> @export var x
  • onready var y -> @onready var y
  • tool -> @tool (at top of file)

2. Setters and Getters

Properties now define setters/​getters inline.

Godot 3:

var health setget set_health, get_health

func set_health(value):
    health = value

Godot 4:

var health: int:
    set(value):
        health = value
        emit_signal("health_changed", health)
    get:
        return health

3. Tween System

The Tween node is deprecated. Use create_tween() in code.

Godot 3:

$Tween.interpolate_property(...)
$Tween.start()

Godot 4:

var tween = create_tween()
tween.tween_property($Sprite, "position", Vector2(100, 100), 1.0)
tween.parallel().tween_property($Sprite, "modulate:a", 0.0, 1.0)

4. Signal Connections

String-based connections are discouraged. Use callables.

Godot 3:

connect("pressed", self, "_on_pressed")

Godot 4:

pressed.connect(_on_pressed)

Examples

Example 1: Typed Arrays

GDScript 2.0 supports typed arrays for better performance and type safety.

# Godot 3
var enemies = []

# Godot 4
var enemies: Array[Node] = []

func _ready():
    for child in get_children():
        if child is Enemy:
            enemies.append(child)

Example 2: Awaiting Signals (Coroutines)

yield is replaced by await.

Godot 3:

yield(get_tree().create_timer(1.0), "timeout")

Godot 4:

await get_tree().create_timer(1.0).timeout

Best Practices

  • ✅ Do: Use @export_range, @export_file, etc., for better inspector UI.
  • ✅ Do: Type all variables (var x: int) for performance gains in GDScript 2.0.
  • ✅ Do: Use super() to call parent methods instead of .function_name().
  • ❌ Don't: Use string names for signals (emit_signal("name")) if you can use the signal object (name.emit()).

Troubleshooting

Problem: "Identifier 'Tween' is not a valid type." Solution: Tween is now SceneTreeTween or just an object returned by create_tween(). You rarely type it explicitly, just use var tween = create_tween().

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

More skills from sickn33

api-security-best-practices logo
sickn33/antigravity-awesome-skills

api-security-best-practices

Implement secure API design patterns including authentication, authorization, input validation, rate limiting, and protection against common API vulnerabilities

47.3K 7.4K
View
nextjs-best-practices logo
sickn33/antigravity-awesome-skills

nextjs-best-practices

Next.js App Router principles. Server Components, data fetching, routing patterns.

47.3K 5.7K
View
nextjs-supabase-auth logo
sickn33/antigravity-awesome-skills

nextjs-supabase-auth

Expert integration of Supabase Auth with Next.js App Router

47.3K 5.2K
View
browser-automation logo
sickn33/antigravity-awesome-skills

browser-automation

Browser automation powers web testing, scraping, and AI agent

47.3K 5.1K
View
prisma-expert logo
sickn33/antigravity-awesome-skills

prisma-expert

prisma expert

47.3K 3.6K
View
playwright-skill logo
sickn33/antigravity-awesome-skills

playwright-skill

playwright skill

47.3K 3.3K
View
game-development logo
sickn33/antigravity-awesome-skills

game-development

Game development orchestrator. Routes to platform-specific skills based on project needs.

47.3K 2.7K
View
mobile-design logo
sickn33/antigravity-awesome-skills

mobile-design

(Mobile-First · Touch-First · Platform-Respectful)

47.3K 2.6K
View
ui-ux-pro-max logo
sickn33/antigravity-awesome-skills

ui-ux-pro-max

ui ux pro max

47.3K 2.5K
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View