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.

Upgrading from Godot 4.5 to Godot 4.6

Для большинства игр и приложений сделанных на Godot 4.5, переход на 4.6 будет относительно безопасным. Эта страница нужна, для того, чтобы показать, на что обратить внимание при переходе вашего проекта.

Изменения ломающие обратную совместимость

Если вы переходите с версии 4.4 на 4.5, перечисленные здесь критические изменения могут вас затронуть. Изменения сгруппированы по областям/системам.

Эта статья показывает, где каждое изменение обратной совместимости влияет на GDScript и где изменение обратной совместимости C# бинарно совместимо или совместимо на уровне кода:

  • Binary compatible (Совместимость на уровне двоичных файлов) — Существующие двоичные файлы будут успешно загружены и выполнены без перекомпиляции, а поведение среды выполнения не изменится.

  • Совместимо на уровне кода - Исходный код будет успешно компилироваться без изменений при обновлении Godot.

Ядро

Изменение

Совместимо с GDScript

Совместимо с бинарным кодом C#

Совместимо с исходным кодом C#

Введено в

FileAccess (Доступ к файлам)

Method create_temp changes mode_flags parameter type from int to FileAccess.ModeFlags

✔️

✔️

✔️

GH-114053

Method get_as_text removes skip_cr parameter

✔️

✔️

✔️

GH-110867

Производительность

Method add_custom_monitor adds a new type optional parameter

✔️

✔️

✔️

GH-110433

Анимация

Изменение

Совместимо с GDScript

Совместимо с бинарным кодом C#

Совместимо с исходным кодом C#

Введено в

AnimationPlayer

Property assigned_animation changes type from String to StringName

✔️

GH-110767

Property autoplay changes type from String to StringName

✔️

GH-110767

Property current_animation changes type from String to StringName

✔️

GH-110767

Method get_queue changes return type from PackedStringArray to StringName[]

✔️

GH-110767

Signal current_animation_changed changes name parameter type from String to StringName

✔️

GH-110767

3D

Изменение

Совместимо с GDScript

Совместимо с бинарным кодом C#

Совместимо с исходным кодом C#

Введено в

SpringBoneSimulator3D

Method get_end_bone_direction changes return type from SpringBoneSimulator3D.BoneDirection to SkeletonModifier3D.BoneDirection

✔️

✔️

GH-110120

Method get_joint_rotation_axis changes return type from SpringBoneSimulator3D.RotationAxis to SkeletonModifier3D.RotationAxis

✔️

✔️

GH-110120

Method get_rotation_axis changes return type from SpringBoneSimulator3D.RotationAxis to SkeletonModifier3D.RotationAxis

✔️

✔️

GH-110120

Method set_end_bone_direction changes bone_direction parameter type from SpringBoneSimulator3D.BoneDirection to SkeletonModifier3D.BoneDirection

✔️

✔️

GH-110120

Method set_joint_rotation_axis changes axis parameter type from SpringBoneSimulator3D.RotationAxis to SkeletonModifier3D.RotationAxis

✔️

✔️

GH-110120

Method set_rotation_axis changes axis parameter type from SpringBoneSimulator3D.RotationAxis to SkeletonModifier3D.RotationAxis

✔️

✔️

GH-110120

Отрисовка

Изменение

Совместимо с GDScript

Совместимо с бинарным кодом C#

Совместимо с исходным кодом C#

Введено в

DisplayServer

Method accessibility_create_sub_text_edit_elements adds a new is_last_line optional parameter

✔️

✔️

✔️

GH-113459

Method tts_speak changes utterance_id parameter type metadata from int32 to int64

✔️

✔️

✔️

GH-112379

GUI узлы

Изменение

Совместимо с GDScript

Совместимо с бинарным кодом C#

Совместимо с исходным кодом C#

Введено в

Control

Method grab_focus adds a new hide_focus optional parameter

✔️

✔️

✔️

GH-110250

Method has_focus adds a new ignore_hidden_focus optional parameter

✔️

✔️

✔️

GH-110250

FileDialog

Method add_filter adds a new mime_type optional parameter

✔️

✔️

✔️

GH-111439

LineEdit

Method edit adds a new hide_focus optional parameter

✔️

✔️

✔️

GH-111117

SplitContainer

Method clamp_split_offset adds a new priority_index optional parameter

✔️

✔️

✔️

GH-90411

Сетевое взаимодействие

Изменение

Совместимо с GDScript

Совместимо с бинарным кодом C#

Совместимо с исходным кодом C#

Введено в

StreamPeerTCP

Method disconnect_from_host moved to base class StreamPeerSocket

✔️

✔️

✔️

GH-107954

Method get_status moved to base class StreamPeerSocket

✔️

✔️

GH-107954

Method poll moved to base class StreamPeerSocket

✔️

✔️

✔️

GH-107954

TCPServer

Method is_connection_available moved to base class SocketServer

✔️

✔️

✔️

GH-107954

Method is_listening moved to base class SocketServer

✔️

✔️

✔️

GH-107954

Method stop moved to base class SocketServer

✔️

✔️

✔️

GH-107954

OpenXR

Изменение

Совместимо с GDScript

Совместимо с бинарным кодом C#

Совместимо с исходным кодом C#

Введено в

OpenXRExtensionWrapper

Method _get_requested_extensions adds a new xr_version parameter

GH-109302

Method _set_instance_create_info_and_get_next_pointer adds a new xr_version parameter

N/A

N/A

N/A

GH-109302

Примечание

Тип OpenXRExtensionWrapper предназначен для создания подклассов через GDExtension. Метод _set_instance_create_info_and_get_next_pointer имеет параметр типа void*, поэтому он не доступен для написания скриптов.

Редактор

Изменение

Совместимо с GDScript

Совместимо с бинарным кодом C#

Совместимо с исходным кодом C#

Введено в

EditorExportPreset

Method get_script_export_mode changes return type from int to EditorExportPreset.ScriptExportMode

✔️

GH-107167

EditorFileDialog

Метод add_filter был перенесен в базовый класс FileDialog

✔️

✔️

✔️

GH-111212

Метод add_option был перенесен в базовый класс FileDialog

✔️

✔️

✔️

GH-111212

Method add_side_menu был удален

с заглушкой

с заглушкой

с заглушкой

GH-111162

Method clear_filename_filter moved to base class FileDialog

✔️

✔️

✔️

GH-111212

Метод clear_filters был перенесен в базовый класс FileDialog

✔️

✔️

✔️

GH-111212

Method get_filename_filter moved to base class FileDialog

✔️

✔️

✔️

GH-111212

Method get_line_edit moved to base class FileDialog

✔️

✔️

✔️

GH-111212

Method get_option_default moved to base class FileDialog

✔️

✔️

✔️

GH-111212

Method get_option_name moved to base class FileDialog

✔️

✔️

✔️

GH-111212

Method get_option_values moved to base class FileDialog

✔️

✔️

✔️

GH-111212

Method get_selected_options moved to base class FileDialog

✔️

✔️

✔️

GH-111212

Method get_vbox moved to base class FileDialog

✔️

✔️

✔️

GH-111212

Method invalidate moved to base class FileDialog

✔️

✔️

✔️

GH-111212

Method popup_file_dialog moved to base class FileDialog

✔️

✔️

✔️

GH-111212

Method set_filename_filter moved to base class FileDialog

✔️

✔️

✔️

GH-111212

Method set_option_default moved to base class FileDialog

✔️

✔️

✔️

GH-111212

Method set_option_name moved to base class FileDialog

✔️

✔️

✔️

GH-111212

Method set_option_values moved to base class FileDialog

✔️

✔️

✔️

GH-111212

Property access moved to base class FileDialog

✔️

✔️

GH-111212

Property current_dir moved to base class FileDialog

✔️

✔️

✔️

GH-111212

Property current_file moved to base class FileDialog

✔️

✔️

✔️

GH-111212

Property current_path moved to base class FileDialog

✔️

✔️

✔️

GH-111212

Property display_mode moved to base class FileDialog

✔️

✔️

GH-111212

Property file_mode moved to base class FileDialog

✔️

✔️

GH-111212

Property filters moved to base class FileDialog

✔️

✔️

✔️

GH-111212

Property option_count moved to base class FileDialog

✔️

✔️

✔️

GH-111212

Property show_hidden_files moved to base class FileDialog

✔️

✔️

✔️

GH-111212

Signal dir_selected moved to base class FileDialog

✔️

✔️

GH-111212

Signal filename_filter_changed moved to base class FileDialog

✔️

✔️

GH-111212

Signal file_selected moved to base class FileDialog

✔️

✔️

GH-111212

Signal files_selected moved to base class FileDialog

✔️

✔️

GH-111212

Изменения в поведении

Android

Примечание

Конфигурация исходных наборов для шаблонов экспорта Android была обновлена, чтобы соответствовать структуре проекта Android Studio по умолчанию (GH-110829). Это влияет на расположение каталогов в проекте Android:

  • Файлы, которые ранее были в [Project root]/android/build/src/, теперь находятся в [Project root]/android/build/src/main/java/.

  • Файл манифеста Android и каталог ресурсов были перемещены в подкаталоги src/main/.

Например, GodotApp.java перемещенный из src/com/godot/game/GodotApp.java в src/main/java/com/godot/game/GodotApp.java.

Ядро

Примечание

The Формат файла TSCN has changed in two ways in Godot 4.6:

  • load_steps is no longer written in scene files (GH-103352). This attribute wasn't used by the editor.

  • Unique node IDs are now saved to scene files to help track nodes when they are moved or renamed (GH-106837). This makes scene refactoring significantly more robust.

The changes are backwards-compatible and forwards-compatible, which means scenes saved in Godot 4.5 can still be loaded in Godot 4.6 and vice-versa (notwithstanding other incompatible changes performed in the scene itself).

As a result, when saving a scene that was last edited in Godot 4.5 in Godot 4.6, significant diffs will occur in version control programs. These diffs are expected.

As a reminder, you can upgrade all files in a project to the latest format using Project > Tools > Upgrade Project Files... in the editor, then committing the changes to version control. This allows you to avoid large diffs later on when editing scenes.

Отрисовка

Примечание

The default blend mode for Glow is now Screen, which looks more correct but is significantly brighter than the previous Soft Light mode (GH-110671).

Several other glow defaults were changed to ensure the glow didn't become too strong, but you will likely need to tweak glow properties in Environment after upgrading.

In addition, glow's Soft Light blend mode now always behaves as it did previously with use_hdr_2d, regardless of the Viewport's use_hdr_2d setting (GH-109971).

When using the Mobile renderer, the rewritten glow effect will look significantly different to the previous one for performance reasons (GH-110077). You may need to further adjust glow settings in Environment to achieve a similar look to before.

Примечание

Volumetric fog blending has been changed to be more physically accurate (GH-112494). This will cause volumetric fog to appear brighter in most scenes.

To compensate for this, you will need to decrease volumetric fog density or brightness in Environment, or decrease the Volumetric Fog Energy property on specific lights.

Changed defaults

Следующие значения по умолчанию были изменены. Если ваш проект использует прежние значения по умолчанию, возможно, вам придется явно задать для них старые значения.

Примечание

Драйвером рендеринга по умолчанию в Windows для вновь созданных проектов теперь является D3D12 (GH-113213). Это можно изменить в Настройках проекта в разделе rendering/rendering_device/driver.windows.

Примечание

Физическим 3D-движком по умолчанию для вновь созданных проектов теперь является Jolt Physics (GH-105737). Это можно изменить в Настройках проекта в разделе physics/3d/physics_engine.

3D

Member

Old Value

New Value

Введено в

MeshInstance3D

Property skeleton

NodePath("..")

NodePath("")

GH-112267

Примечание

Значение по умолчанию для skeleton изменилось. Включите animation/compatibility/default_parent_skeleton_in_mesh_instance_3d в Настройках проекта, если для совместимости требуется старое поведение.

Отрисовка

Member

Old Value

New Value

Введено в

ProjectSettings

Свойство rendering/reflections/sky_reflections/roughness_layers

8

7

GH-107902

Свойство rendering/rendering_device/d3d12/agility_sdk_version

613

618

GH-114043

Environment

Property glow_blend_mode

2

1

GH-110671

Property glow_intensity

0.8

0.3

GH-110671

Property glow_levels/2

0.0

0.8

GH-110671

Property glow_levels/3

1.0

0.4

GH-110671

Property glow_levels/4

0.0

0.1

GH-110671

Property glow_levels/5

1.0

0.0

GH-110671

Свойство ssr_depth_tolerance

0.2

0.5

GH-111210

GUI узлы

Property/Parameter

Old Value

New Value

Введено в

Всплывающее меню

Property submenu_popup_delay

0.3

0.2

GH-110256

ResourceImporterCSVTranslation

Property compress

true

1

GH-112073