Upgrading from Godot 4.4 to Godot 4.5
For most games and apps made with 4.4 it should be relatively safe to migrate to 4.5. This page intends to cover everything you need to pay attention to when migrating your project.
Cambios importantes
If you are migrating from 4.4 to 4.5, the breaking changes listed here might affect you. Changes are grouped by areas/systems.
Advertencia
Para cumplir con los "nuevos requisitos de Google Play", Android ahora requiere apuntar a .NET 9 al exportar proyectos de C# a Android; otras plataformas continúan usando .NET 8 como la versión mínima requerida, pero se admiten y recomiendan versiones más nuevas.
If you are using C# in your project and want to export to Android, you will need to upgrade your project to .NET 9 (see Upgrading to a new .NET version for instructions).
Este artículo indica si cada cambio significativo afecta a GDScript y si el cambio significativo en C# es compatible binario o compatible con el código fuente:
Binary compatible - Existing binaries will load and execute successfully without recompilation, and the run-time behavior won't change.
Compatible con el código fuente: el código fuente se compila correctamente sin ningún cambio al actualizar Godot.
Núcleo
Cambio |
Compatibilidad con GDScript |
Compatible con binarios C# |
Compatible con código fuente C# |
Introducido |
|---|---|---|---|---|
JSONRPC |
||||
Method |
❌ |
❌ |
❌ |
|
Node |
||||
Method |
❌ |
|||
Method |
✔️ |
Renderizado
Cambio |
Compatibilidad con GDScript |
Compatible con binarios C# |
Compatible con código fuente C# |
Introducido |
|---|---|---|---|---|
DisplayServer |
||||
Method |
✔️ |
|||
Method |
✔️ |
|||
RenderingDevice |
||||
Method |
✔️ |
|||
RenderingServer |
||||
Method |
❌ |
|||
Method |
❌ |
Nota
In C#, the enum RenderingDevice.Features breaks compatibility because of the way the bindings generator
detects the enum prefix. New members were added to the enum in GH-103941 that caused the enum member
Address to be renamed to BufferDeviceAddress.
GLTF
Cambio |
Compatibilidad con GDScript |
Compatible con binarios C# |
Compatible con código fuente C# |
Introducido |
|---|---|---|---|---|
GLTFAccessor |
||||
Property |
✔️ |
❌ |
❌ |
|
Property |
✔️ |
❌ |
❌ |
|
Property |
✔️ |
❌ |
❌ |
|
Property |
✔️ |
❌ |
❌ |
|
Property |
✔️ |
❌ |
❌ |
|
Property |
✔️ |
❌ |
❌ |
|
Property |
✔️ |
❌ |
❌ |
|
GLTFBufferView |
||||
Property |
✔️ |
❌ |
❌ |
|
Property |
✔️ |
❌ |
❌ |
|
Property |
✔️ |
❌ |
❌ |
Nota
Como resultado de cambiar los metadatos de tipo, los enlaces de C# cambiaron el tipo de int (32 bytes) a long (64 bytes).
Text
Cambio |
Compatibilidad con GDScript |
Compatible con binarios C# |
Compatible con código fuente C# |
Introducido |
|---|---|---|---|---|
CanvasItem |
||||
Method |
✔️ |
|||
Method |
✔️ |
|||
Method |
✔️ |
|||
Method |
✔️ |
|||
Method |
✔️ |
|||
Method |
✔️ |
|||
Fuente |
||||
Method |
✔️ |
|||
Method |
✔️ |
|||
Method |
✔️ |
|||
Method |
✔️ |
|||
Method |
✔️ |
|||
Method |
✔️ |
|||
RichTextLabel |
||||
Method |
✔️ |
|||
El método |
✔️ |
|||
Method |
✔️ |
|||
Method |
✔️ |
|||
Method |
✔️ |
|||
El método |
✔️ |
|||
TextLine |
||||
Method |
✔️ |
|||
Method |
✔️ |
|||
TextParagraph |
||||
Method |
✔️ |
|||
Method |
✔️ |
|||
Method |
✔️ |
|||
Method |
✔️ |
|||
Method |
✔️ |
|||
Method |
✔️ |
|||
TextServer |
||||
Method |
✔️ |
|||
Method |
✔️ |
|||
Method |
✔️ |
|||
Method |
✔️ |
|||
TreeItem |
||||
Method |
✔️ |
|||
TextServerExtension |
||||
Method |
❌ |
❌ |
❌ |
|
Method |
❌ |
❌ |
❌ |
|
Method |
❌ |
❌ |
❌ |
|
Method |
❌ |
❌ |
❌ |
XR
Cambio |
Compatibilidad con GDScript |
Compatible con binarios C# |
Compatible con código fuente C# |
Introducido |
|---|---|---|---|---|
OpenXRAPIExtension |
||||
Method |
✔️ |
|||
Method |
✔️ |
|||
Method |
✔️ |
|||
Method |
✔️ |
|||
OpenXRBindingModifierEditor |
||||
El tipo |
❌ |
❌ |
❌ |
|
OpenXRInteractionProfileEditor |
||||
El tipo |
❌ |
❌ |
❌ |
|
OpenXRInteractionProfileEditorBase |
||||
El tipo |
❌ |
❌ |
❌ |
Nota
Las clases OpenXRBindingModifierEditor, OpenXRInteractionProfileEditor y OpenXRInteractionProfileEditorBase solo están disponibles en el editor. Usarlas fuera del editor provocará un error de compilación.
In C#, this means the types are moved from the GodotSharp assembly to the GodotSharpEditor assembly.
Make sure to wrap code that uses these types in a #if TOOLS block to ensure they are not included in an exported game.
Este cambio también se incorporó a la versión 4.4.1.
Plugins del editor
Cambio |
Compatibilidad con GDScript |
Compatible con binarios C# |
Compatible con código fuente C# |
Introducido |
|---|---|---|---|---|
EditorExportPlatform |
||||
Method |
✔️ |
|||
EditorUndoRedoManager |
||||
Method |
✔️ |
|||
EditorExportPlatformExtension |
||||
Method |
✔️ |
❌ |
❌ |
Cambios de comportamiento
In 4.5, some behavior changes have been introduced, which might require you to adjust your project.
TileMapLayer
TileMapLayer.get_coords_for_body_rid()
will return different values in 4.5 compared to 4.4,
as TileMapLayer physics chunking is enabled by default. Higher values of
TileMapLayer.physics_quadrant_size
will make this function less precise. To get the exact cell coordinates like in 4.4 and prior
versions, you need to set
TileMapLayer.physics_quadrant_size
to 1, which disables physics chunking.
Importar modelo 3D
A fix has been made to the 3D model importers to correctly handle non-joint nodes within a skeleton hierarchy (GH-104184).
To preserve compatibility, the default behavior is to import existing files with the same behavior as before (GH-107352).
New .gltf, .glb, .blend, and .fbx files (without a corresponding .import file)
will be imported with the new behavior. However, for existing files, if you want to use the
new behavior, you must change the "Naming Version" option at the bottom of the Import dock:
Núcleo
Nota
Resource.duplicate(true) (which performs deep duplication) now only duplicates resources internal to the resource file it's called on. In 4.4, this duplicated everything instead, including external resources. If you were deep-duplicating a resource that contained references to other external resources, those external resources aren't duplicated anymore. You must call Resource.duplicate_deep(RESOURCE_DEEP_DUPLICATE_ALL) instead to keep the old behavior.
Nota
ProjectSettings.add_property_info()
now prints a warning when the dictionary parameter has missing keys or invalid keys.
Most importantly, it will now warn when a usage key is passed, as this key is not used.
This was also the case before 4.5, but it was silently ignored instead.
As a reminder, to set property usage information correctly, you must use
ProjectSettings.set_as_basic(),
ProjectSettings.set_restart_if_changed(),
or ProjectSettings.set_as_internal() instead.
Nota
In C#, StringExtensions.PathJoin now avoids adding an extra path separator when the original string is empty,
or when the appended path starts with a path separator (GH-105281).
Nota
En C#, StringExtensions.GetExtension ahora devuelve una cadena vacía en lugar de la cadena original cuando la cadena original no contiene una extensión (GH-108041).
Nota
En C#, el constructor Quaternion(Vector3, Vector3) ahora crea correctamente un cuaternión que representa el arco más corto entre los dos vectores de entrada. Anteriormente, devolvía valores incorrectos para ciertas entradas (GH-107618).
Física
Nota
Cuando el motor de física 3D está configurado en Jolt Physics, ahora siempre se informarán superposiciones entre Area3D y los cuerpos estáticos de forma predeterminada, ya que se ha eliminado la configuración del proyecto physics/jolt_physics_3d/simulation/areas_detect_static_bodies (GH-105746). Si aún desea que se ignoren estas superposiciones, deberá cambiar la máscara o capa de colisión de Area3D o del cuerpo estático.
Text
Nota
En GDScript, las llamadas a las funciones RichTextLabel::add_image y RichTextLabel::update_image seguirán funcionando, pero el argumento size_in_percent se usará como valor para width_in_percent y el valor predeterminado de height_in_percent será false (GH-107347). Para restablecer el comportamiento anterior, puede establecer explícitamente height_in_percent con el mismo valor que pasaba como size_in_percent.