Skip to content
Skillpedia
General coding48k · #3152

godot-4-migration

Specialized guide for updating Godot 3 projects to Godot 4. Covers language changes and specific features.

What it does

This guide helps you update your game made in Godot 3 to Godot 4. It explains changes in code writing (GDScript 2.0), how to use animations (Tweens), and how to declare variables that appear in game settings (exports).

When to use it

  • ✓When you are updating a game from Godot 3 to Godot 4.
  • ✓When your game's code stops working after the update.
  • ✓When you need to change how animations work.

Example of what to ask your AI

“How do I update how I declare configuration variables in Godot 4?”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/godot-4-migration/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/godot-4-migration/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

The AI compares old Godot 3 code with the new Godot 4 rules, showing examples of how to rewrite specific parts of your game, like animations and variable declarations.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add sickn33/agentic-awesome-skills --skill godot-4-migration

Or download just the file:

curl -L https://raw.githubusercontent.com/sickn33/agentic-awesome-skills/main/plugins/agentic-awesome-skills-claude/skills/godot-4-migration/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

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.

Migration procedure

Work in a backed-up branch or copy. Choose an exact Godot 4 version, validate conversion before changing files, and inspect converter gaps, renamed nodes, shaders, physics, plugins and export targets. Test scenes and saved games before replacing the working Godot 3 build. Examples below are fragments in an appropriate Node script; Enemy must be a declared project type.

Official guide: Upgrading to Godot 4.

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:

signal health_changed(health: int)

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

3. Tween System

The Godot 3 Tween node was removed in Godot 4. 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 type checking; measure performance rather than assuming a speedup.

# 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: Godot 4 uses a Tween object returned by create_tween(), not a scene node or a SceneTreeTween type. Use var tween: Tween = create_tween() in a Node context.

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.
FAQ

What are 'exports'?

These are variables you can configure directly in Godot's tools without changing the code. In Godot 4, they use '@export'.

What changed with animations (Tweens)?

In Godot 3, you used a node called 'Tween'. In Godot 4, you create animations directly in code using 'create_tween()'.

Why doesn't my code with 'yield' work anymore?

'yield' has been replaced by 'await' in Godot 4. You need to swap one word for the other in your code.

Details

Original description by the author

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

repo: sickn33/agentic-awesome-skills

Popularity

GitHub stars
48k
Ranking position
#3152
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills