Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
Upgrading from Godot 4.2 to Godot 4.3
For most games and apps made with 4.2 it should be relatively safe to migrate to 4.3. This page intends to cover everything you need to pay attention to when migrating your project.
做出更改
If you are migrating from 4.2 to 4.3, the breaking changes listed here might affect you. Changes are grouped by areas/systems.
這篇文章指出了每項破壞性改動是否會影響 GDScript,以及 C# 的破壞性改動是 二進位相容 還是 原始程式碼相容:
Binary compatible - Existing binaries will load and execute successfully without recompilation, and the runtime behavior won't change.
** 原始程式碼相容** —— 在升級 Godot 時,原始程式碼可成功編譯,無需更改。
GDExtension
改動 |
GDScript 格式化字串 |
C# 二進位相容 |
C# 原始程式碼相容 |
簡介 |
---|---|---|---|---|
GDExtension |
||||
Method |
❌ |
❌ |
❌ |
|
Method |
❌ |
❌ |
❌ |
|
Method |
❌ |
❌ |
❌ |
Since it was basically impossible to use these methods in any useful way, these methods have been removed. Use GDExtensionManager::load_extension
and GDExtensionManager::unload_extension
instead to correctly load and unload a GDExtension.
動畫
改動 |
GDScript 格式化字串 |
C# 二進位相容 |
C# 原始程式碼相容 |
簡介 |
---|---|---|---|---|
動畫 |
||||
Method |
✔️ |
✔️ |
✔️ |
|
Method |
✔️ |
✔️ |
✔️ |
|
Method |
✔️ |
✔️ |
✔️ |
|
Method |
✔️ |
✔️ |
✔️ |
|
Method |
✔️ |
✔️ |
✔️ |
|
Method |
✔️ |
✔️ |
✔️ |
|
Method |
✔️ |
✔️ |
✔️ |
|
AnimationMixer |
||||
Method |
✔️ |
❌ |
❌ |
|
Skeleton3D |
||||
Method |
✔️ |
❌ |
✔️ |
|
Signal |
❌ |
❌ |
❌ |
|
BoneAttachment3D |
||||
Method |
✔️ |
✔️ |
✔️ |
建立節點
改動 |
GDScript 格式化字串 |
C# 二進位相容 |
C# 原始程式碼相容 |
簡介 |
---|---|---|---|---|
AcceptDialog |
||||
Method |
✔️ |
✔️ |
✔️ |
|
Method |
✔️ |
✔️ |
✔️ |
物理
改動 |
GDScript 格式化字串 |
C# 二進位相容 |
C# 原始程式碼相容 |
簡介 |
---|---|---|---|---|
PhysicsShapeQueryParameters3D |
||||
Property |
❌ |
❌ |
❌ |
備註
In C#, the enum PhysicsServer3D.G6DofJointAxisFlag
breaks compatibility because of the way the bindings generator
detects the enum prefix. New members were added in GH-89851 to the enum that caused the enum members to be renamed.
算繪
改動 |
GDScript 格式化字串 |
C# 二進位相容 |
C# 原始程式碼相容 |
簡介 |
---|---|---|---|---|
算繪 |
||||
Enum field |
✔️ |
❌ |
❌ |
|
Enum field |
✔️ |
❌ |
❌ |
|
Enum field |
✔️ |
❌ |
❌ |
|
Enum field |
✔️ |
❌ |
❌ |
|
Enum field |
✔️ |
❌ |
❌ |
|
Enum field |
✔️ |
❌ |
❌ |
|
Method |
✔️ |
✔️ |
✔️ |
|
Method |
✔️ |
✔️ |
✔️ |
|
Method |
✔️ |
✔️ |
✔️ |
|
Method |
✔️ |
✔️ |
✔️ |
|
Method |
✔️ |
✔️ |
✔️ |
|
Method |
✔️ |
✔️ |
✔️ |
|
Method |
✔️ |
✔️ |
✔️ |
|
Method |
✔️ |
✔️ |
✔️ |
|
Method |
✔️ |
✔️ |
✔️ |
|
Method |
✔️ |
✔️ |
✔️ |
|
RenderingServer |
||||
Method |
✔️ |
✔️ |
✔️ |
|
RenderSceneBuffersRD |
||||
Method |
✔️ |
✔️ |
✔️ |
|
Method |
✔️ |
✔️ |
✔️ |
|
Method |
✔️ |
✔️ |
✔️ |
|
Method |
✔️ |
✔️ |
✔️ |
|
Method |
✔️ |
✔️ |
✔️ |
|
Method |
✔️ |
✔️ |
✔️ |
備註
While the values of the enum fields in RenderingDevice.InitialAction
and RenderingDevice.FinalAction
changed,
the only method that consumed them (draw_list_begin
) added a compatibility method which supports the old values.
So in practice it doesn't break compatibility.
備註
In C#, the enum RenderingDevice.DriverResource
breaks compatibility because of the way the bindings generator
detects the enum prefix. New members were added in GH-83452 to the enum that caused the enum members to be
renamed.
Text
改動 |
GDScript 格式化字串 |
C# 二進位相容 |
C# 原始程式碼相容 |
簡介 |
---|---|---|---|---|
霧: |
||||
Method |
✔️ |
✔️ |
✔️ |
|
RichTextLabel |
||||
Method |
✔️ |
✔️ |
✔️ |
|
TextServer |
||||
Method |
✔️ |
✔️ |
✔️ |
|
TextServerExtension |
||||
Method |
❌ |
❌ |
❌ |
音訊
改動 |
GDScript 格式化字串 |
C# 二進位相容 |
C# 原始程式碼相容 |
簡介 |
---|---|---|---|---|
AudioStreamPlaybackPolyphonic |
||||
Method |
✔️ |
✔️ |
✔️ |
TileMap
改動 |
GDScript 格式化字串 |
C# 二進位相容 |
C# 原始程式碼相容 |
簡介 |
---|---|---|---|---|
TileData |
||||
Method |
✔️ |
✔️ |
✔️ |
|
Method |
✔️ |
✔️ |
✔️ |
XR
改動 |
GDScript 格式化字串 |
C# 二進位相容 |
C# 原始程式碼相容 |
簡介 |
---|---|---|---|---|
WebXRInterface |
||||
Method |
✔️ |
❌ |
✔️ |
|
XRServer |
||||
Method |
✔️ |
❌ |
❌ |
編輯器外掛程式
改動 |
GDScript 格式化字串 |
C# 二進位相容 |
C# 原始程式碼相容 |
簡介 |
---|---|---|---|---|
EditorInspectorPlugin |
||||
Method |
✔️ |
✔️ |
✔️ |
|
EditorPlugin |
||||
Method |
✔️ |
✔️ |
✔️ |
|
Method |
✔️ |
✔️ |
✔️ |
|
EditorSceneFormatImporterFBX |
||||
Type renamed to |
❌ |
❌ |
❌ |
做出更改
In 4.3 some behavior changes have been introduced, which might require you to adjust your project.
核心
備註
Binary serialization was modified to fix some issues with the serialization of scripted Objects and typed Arrays (GH-78219). This breaks compat with script encoding/decoding.
備註
PackedByteArray
is now able to use a more compact base64 encoding for storage. But the trade-off is that it breaks
compatibility, meaning that older versions of Godot may not be able to open resources saved by 4.3 (GH-89186).
To maximize compatibility, this new storage format will only be enabled for resources and scenes that contain large PackedByteArrays for now. Support for this new format will also be added in patch updates for older versions of Godot. Once all supported Godot versions are able to read the new format, we will gradually retire the compatibility measures and have all resources and scenes use the new storage format.
備註
In C#, the Transform3D.InterpolateWith
implementation was fixed to use the right order of operations, applying the rotation before the scale (GH-89843).
備註
In C#, the Aabb.GetSupport
implementation was fixed to properly return the support vector (GH-88919).
備註
In C#, the Variant types' ToString
implementation now defaults to using the InvariantCulture
(GH-89547)
which means Vector2(1.2, 3.4)
is formatted using .
as the decimal separator independently of the language
of the operating system that the program is running on.
動畫
備註
AnimationMixer
replaced its Capture mode with a new Capture feature that works much better than the old one,
this replaces the existing cache (GH-86715).
備註
AnimationNode
has a reworked process for retrieving the semantic time info. This ensures that time-related
behavior works as expected, but changes the blending behavior. Implementors of the _process
virtual method
should also note that this method is now deprecated and will be replaced by a new one in the future (GH-87171).
More information about the changes to Animation can be found in the Migrating Animations from Godot 4.0 to 4.3 article.
建立節點
備註
The default font outline color was changed from white to black (GH-54641).
備註
The auto_translate
property is deprecated in favor of the auto_translate_mode
property which is now in Node
(GH-87530).
The default value for auto_translate_mode
is AUTO_TRANSLATE_INHERIT
, which means nodes inherit the auto_translate_mode
value
from their parent. This means, existing nodes with the auto_translate
property set to true
may no longer be translated if they
are children of a node with the auto_translate
property set to false
.
Multiplayer
備註
The SceneMultiplayer
caching protocol was changed to send the received ID instead of the Node path when sending a node removal confirmation packet (GH-90027).
This is a breaking change for the high-level multiplayer protocol making it incompatible with previous Godot versions. Upgrade both your server and client versions to Godot 4.3 to handle this change gracefully.
Note that high-level multiplayer facilities are only ever meant to be compatible with server and client using the same Godot version. It is recommended to implement some kind of version checking.
算繪
備註
Decals now convert the modulate color from an sRGB color to a linear color, like all other inputs, to ensure proper blending (GH-89849). Existing projects that were using the decal's modulate property will notice a change in their visuals.
備註
The reverse Z depth buffer technique is now implemented. This may break compatibility for some shaders. Read the Introducing Reverse Z (AKA I'm sorry for breaking your shader) article for more information and guidance on how to fix common scenarios.
TileMap
Android
備註
Android permissions are no longer requested automatically because it goes against the recommended best practices (GH-87080).
Use the request_permission
method in OS
and the on_request_permissions_result
signal on MainLoop
to request
permissions and wait for the user response.