スキル godot-4-migration
🎮

godot-4-migration

安全

將 Godot 3 遷移至 Godot 4

升級 Godot 專案的遊戲開發者會面臨語法錯誤和已棄用的功能。此技能提供遷移 GDScript 2.0 程式碼的全面指南,並附具體範例。

対応: Claude Codex Code(CC)
📊 69 十分
1

スキルZIPをダウンロード

2

Claudeでアップロード

設定 → 機能 → スキル → スキルをアップロードへ移動

3

オンにして利用開始

テストする

「godot-4-migration」を使用しています。 Convert this Godot 3 code to Godot 4: export var speed = 10

期待される結果:

在 Godot 4 中,使用 @export 標註:

```gdscript
@export var speed: int = 10
```

你也可以新增型別提示和檢查器提示:
```gdscript
@export_range(1, 100) var speed: int = 10
```

「godot-4-migration」を使用しています。 如何在 Godot 4 中使用 Tweens?

期待される結果:

The Tween node is deprecated. Use create_tween() method:

```gdscript
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)
```

セキュリティ監査

安全
v1 • 2/25/2026

All static findings are false positives. The skill contains only documentation for Godot 4 migration with GDScript code examples. No shell commands, cryptographic code, or system reconnaissance present.

1
スキャンされたファイル
127
解析された行数
3
検出結果
1
総監査数
中リスクの問題 (3)
False Positive: Shell Command Detection
Scanner flagged GDScript method calls like create_tween() and $Tween as shell commands. These are Godot game engine API calls, not system commands.
False Positive: Weak Cryptographic Algorithm
Scanner triggered on word 'deprecated' which contains character patterns matching crypto detection. No cryptographic code exists in this skill.
False Positive: System Reconnaissance
Scanner triggered on the word 'Problem:' in troubleshooting section. This is a documentation heading, not reconnaissance.
監査者: claude

品質スコア

38
アーキテクチャ
100
保守性
87
コンテンツ
33
コミュニティ
90
セキュリティ
83
仕様準拠

作れるもの

移植遊戲專案

透過逐步語法指導,系統性地將整個遊戲專案從 Godot 3.x 升級至 Godot 4。

修正語法錯誤

在 Godot 4 中開啟 Godot 3 專案時快速解決編譯錯誤。

學習 GDScript 2.0

了解 GDScript 2.0 中的新功能和模式,適用於新的 Godot 4 開發。

これらのプロンプトを試す

基本遷移協助
如何在 Godot 4 中轉換 @export 變數?顯示舊語法和新語法。
Tween 系統遷移
Convert this Godot 3 Tween code to Godot 4: $Tween.interpolate_property($Sprite, 'position', Vector2(0,0), Vector2(100,100), 1.0, 0, 0)
訊號連接更新
How do I connect signals using callables in Godot 4 instead of connect('signal_name', self, '_handler')?
完整專案評估
列出將 Godot 3 專案遷移至 Godot 4 所需的所有主要語法變更,並為每個類別提供範例。

ベストプラクティス

  • 使用 @export_range、@export_file 和其他 @export 標註以獲得更好的編輯器整合
  • 為所有變數新增明確的型別提示以在 GDScript 2.0 中獲得效能提升
  • 使用 super() 呼叫父類別方法,而非舊的 .method_name() 語法

回避

  • 當你可以使用訊號物件的 name.emit() 時,不要使用 emit_signal('name')
  • 不要使用基於字串的訊號連接,如 connect('pressed', self, '_handler')
  • 不要使用 yield() 進行協程 - 在 Godot 4 中改用 await

よくある質問

此技能會自動轉換我的專案檔案嗎?
否,此技能提供指導和範例。實際轉換必須手動完成或使用 Godot 的內建遷移工具。
我可以使用此技能遷移 C# 程式碼嗎?
否,此技能僅涵蓋 GDScript 語法。C# 遷移需要單獨考量。
GDScript 1.0 和 2.0 之間的主要差異是什麼?
GDScript 2.0 新增型別提示、新標註系統(@export、@onready)、內聯 setters/getters,並將 yield 替換為 await。
如何在 Godot 4 中處理 onready 變數?
使用 @onready 標註:@onready var sprite = $Sprite 而非 onready var sprite = $Sprite
Tween 節點在 Godot 4 中仍然可用嗎?
Tween 節點已棄用。在腳本中使用 create_tween() 方法以程式化方式建立 Tweens。
我可以在 Godot 4 中使用 Godot 3 資源嗎?
大多數資源可以使用,但有些可能需要更新。貼图和網格通常可以使用,但腳本必須遷移至 GDScript 2.0。

開発者の詳細

ファイル構成

📄 SKILL.md