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.

Migrar desde Godot 4.4 a 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 set_scope replaced by set_method

|❌ con marcador de posición|

|❌ con marcador de posición|

GH-104890

Node

Method get_rpc_config renamed to get_node_rpc_config

|✔️ compatible|

|✔️ compatible|

GH-106848

Method set_name changes name parameter type from String to StringName

✔️

|✔️ compatible|

|✔️ compatible|

GH-76560

Renderizado

Cambio

Compatibilidad con GDScript

Compatible con binarios C#

Compatible con código fuente C#

Introducido

DisplayServer

Method file_dialog_show adds a new parent_window_id optional parameter

✔️

|✔️ compatible|

|✔️ compatible|

GH-98194

Method file_dialog_with_options_show adds a new parent_window_id optional parameter

✔️

|✔️ compatible|

|✔️ compatible|

GH-98194

RenderingDevice

Method texture_create_from_extension adds a new mipmaps optional parameter

✔️

|✔️ compatible|

|✔️ compatible|

GH-105570

RenderingServer

Method instance_reset_physics_interpolation removed

|✔️ compatible|

|✔️ compatible|

GH-104269

Método instance_set_interpolated eliminado

|✔️ compatible|

|✔️ compatible|

GH-104269

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 byte_offset changes type metadata from int32 to int64

✔️

GH-106220

Property component_type changes type from int to GLTFAccessor::GLTFComponentType

✔️

GH-106220

Property count changes type metadata from int32 to int64

✔️

GH-106220

Property sparse_count changes type metadata from int32 to int64

✔️

GH-106220

Property sparse_indices_byte_offset changes type metadata from int32 to int64

✔️

GH-106220

Property sparse_indices_component_type changes type from int to GLTFAccessor::GLTFComponentType

✔️

GH-106220

Property sparse_values_byte_offset changes type metadata from int32 to int64

✔️

GH-106220

GLTFBufferView

Property byte_length changes type metadata from int32 to int64

✔️

GH-106220

Property byte_offset changes type metadata from int32 to int64

✔️

GH-106220

Property byte_stride changes type metadata from int32 to int64

✔️

GH-106220

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 draw_char adds a new oversampling optional parameter

✔️

|✔️ compatible|

|✔️ compatible|

GH-104872

Method draw_char_outline adds a new oversampling optional parameter

✔️

|✔️ compatible|

|✔️ compatible|

GH-104872

Method draw_multiline_string adds a new oversampling optional parameter

✔️

|✔️ compatible|

|✔️ compatible|

GH-104872

Method draw_multiline_string_outline adds a new oversampling optional parameter

✔️

|✔️ compatible|

|✔️ compatible|

GH-104872

Method draw_string adds a new oversampling optional parameter

✔️

|✔️ compatible|

|✔️ compatible|

GH-104872

Method draw_string_outline adds a new oversampling optional parameter

✔️

|✔️ compatible|

|✔️ compatible|

GH-104872

Fuente

Method draw_char adds a new oversampling optional parameter

✔️

|✔️ compatible|

|✔️ compatible|

GH-104872

Method draw_char_outline adds a new oversampling optional parameter

✔️

|✔️ compatible|

|✔️ compatible|

GH-104872

Method draw_multiline_string adds a new oversampling optional parameter

✔️

|✔️ compatible|

|✔️ compatible|

GH-104872

Method draw_multiline_string_outline adds a new oversampling optional parameter

✔️

|✔️ compatible|

|✔️ compatible|

GH-104872

Method draw_string adds a new oversampling optional parameter

✔️

|✔️ compatible|

|✔️ compatible|

GH-104872

Method draw_string_outline adds a new oversampling optional parameter

✔️

|✔️ compatible|

|✔️ compatible|

GH-104872

RichTextLabel

Method add_image adds a new alt_text optional parameter

✔️

|✔️ compatible|

|✔️ compatible|

GH-76829

El método add_image reemplazó el parámetro size_in_percent por width_in_percent y height_in_percent

✔️

|✔️ compatible|

|✔️ compatible|

GH-107347

Method push_strikethrough adds optional color parameter

✔️

|✔️ compatible|

|✔️ compatible|

GH-106300

Method push_table adds a new name optional parameter

✔️

|✔️ compatible|

|✔️ compatible|

GH-76829

Method push_underline adds optional color parameter

✔️

|✔️ compatible|

|✔️ compatible|

GH-106300

El método update_image reemplazó el parámetro size_in_percent por width_in_percent y height_in_percent

✔️

|✔️ compatible|

|✔️ compatible|

GH-107347

TextLine

Method draw adds a new oversampling optional parameter

✔️

|✔️ compatible|

|✔️ compatible|

GH-104872

Method draw_outline adds a new oversampling optional parameter

✔️

|✔️ compatible|

|✔️ compatible|

GH-104872

TextParagraph

Method draw adds a new oversampling optional parameter

✔️

|✔️ compatible|

|✔️ compatible|

GH-104872

Method draw_dropcap adds a new oversampling optional parameter

✔️

|✔️ compatible|

|✔️ compatible|

GH-104872

Method draw_dropcap_outline adds a new oversampling optional parameter

✔️

|✔️ compatible|

|✔️ compatible|

GH-104872

Method draw_line adds a new oversampling optional parameter

✔️

|✔️ compatible|

|✔️ compatible|

GH-104872

Method draw_line_outline adds a new oversampling optional parameter

✔️

|✔️ compatible|

|✔️ compatible|

GH-104872

Method draw_outline adds a new oversampling optional parameter

✔️

|✔️ compatible|

|✔️ compatible|

GH-104872

TextServer

Method font_draw_glyph adds a new oversampling optional parameter

✔️

|✔️ compatible|

|✔️ compatible|

GH-104872

Method font_draw_glyph_outline adds a new oversampling optional parameter

✔️

|✔️ compatible|

|✔️ compatible|

GH-104872

Method shaped_text_draw adds a new oversampling optional parameter

✔️

|✔️ compatible|

|✔️ compatible|

GH-104872

Method shaped_text_draw_outline adds a new oversampling optional parameter

✔️

|✔️ compatible|

|✔️ compatible|

GH-104872

TreeItem

Method add_button adds a new alt_text optional parameter

✔️

|✔️ compatible|

|✔️ compatible|

GH-76829

TextServerExtension

Method _font_draw_glyph adds a new oversampling optional parameter

GH-104872

Method _font_draw_glyph_outline adds a new oversampling optional parameter

GH-104872

Method _shaped_text_draw adds a new oversampling optional parameter

GH-104872

Method _shaped_text_draw_outline adds a new oversampling optional parameter

GH-104872

XR

Cambio

Compatibilidad con GDScript

Compatible con binarios C#

Compatible con código fuente C#

Introducido

OpenXRAPIExtension

Method register_composition_layer_provider changes extension parameter type from OpenXRExtensionWrapperExtension to OpenXRExtensionWrapper

✔️

|✔️ compatible|

|✔️ compatible|

GH-104087

Method register_projection_views_extension changes extension parameter type from OpenXRExtensionWrapperExtension to OpenXRExtensionWrapper

✔️

|✔️ compatible|

|✔️ compatible|

GH-104087

Method unregister_composition_layer_provider changes extension parameter type from OpenXRExtensionWrapperExtension to OpenXRExtensionWrapper

✔️

|✔️ compatible|

|✔️ compatible|

GH-104087

Method unregister_projection_views_extension changes extension parameter type from OpenXRExtensionWrapperExtension to OpenXRExtensionWrapper

✔️

|✔️ compatible|

|✔️ compatible|

GH-104087

OpenXRBindingModifierEditor

El tipo OpenXRBindingModifierEditor cambió el tipo de API de Core a Editor

GH-103869

OpenXRInteractionProfileEditor

El tipo OpenXRInteractionProfileEditor cambió el tipo de API de Core a Editor

GH-103869

OpenXRInteractionProfileEditorBase

El tipo OpenXRInteractionProfileEditorBase cambió el tipo de API de Core a Editor

GH-103869

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 get_forced_export_files adds a new preset optional parameter

✔️

|✔️ compatible|

|✔️ compatible|

GH-71542

EditorUndoRedoManager

Method create_action adds a new mark_unsaved optional parameter

✔️

|✔️ compatible|

|✔️ compatible|

GH-106121

EditorExportPlatformExtension

Method _get_option_icon changes return type from ImageTexture to Texture2D

✔️

GH-108825

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() devolverá valores diferentes en 4.5 en comparación con 4.4, ya que la división en bloques de física (physics chunking) de TileMapLayer está habilitada por defecto. Valores más altos de TileMapLayer.physics_quadrant_size harán que esta función sea menos precisa. Para obtener las coordenadas exactas de celda como en 4.4 y versiones anteriores, debes establecer TileMapLayer.physics_quadrant_size en 1, lo que desactiva la división en bloques de física.

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:

../../_images/gltf_naming_version.webp

Núcleo

Nota

Resource.duplicate(true) (que realiza una duplicación profunda) ahora solo duplica los recursos internos al archivo de recurso sobre el que se llama. En 4.4, en cambio, duplicaba todo, incluidos los recursos externos. Si estabas duplicando en profundidad un recurso que contenía referencias a otros recursos externos, esos recursos externos ya no se duplican. Debes llamar a Resource.duplicate_deep(DEEP_DUPLICATE_ALL) en su lugar para mantener el comportamiento anterior.

Nota

ProjectSettings.add_property_info() ahora muestra una advertencia cuando el parámetro de diccionario tiene claves faltantes o claves no válidas. En particular, ahora advertirá cuando se pase una clave usage, ya que esta clave no se utiliza. Esto también ocurría antes de 4.5, pero se ignoraba silenciosamente. Como recordatorio, para configurar correctamente la información de uso de una propiedad, debes utilizar ProjectSettings.set_as_basic(), ProjectSettings.set_restart_if_changed() o ProjectSettings.set_as_internal() en su lugar.

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.