瀏覽代碼

Merge pull request #7793 from Calinou/upgrading-to-godot-4-lifecycle-functions-super

Max Hilbrunner 2 年之前
父節點
當前提交
05fe756d9d
共有 2 個文件被更改,包括 7 次插入2 次删除
  1. 3 2
      tutorials/migrating/upgrading_to_godot_4.1.rst
  2. 4 0
      tutorials/migrating/upgrading_to_godot_4.rst

+ 3 - 2
tutorials/migrating/upgrading_to_godot_4.1.rst

@@ -3,7 +3,7 @@
 Upgrading from Godot 4.0 to Godot 4.1
 =====================================
 
-For most games and apps made with 4.0 it should be relatively safe to migrate to 4.1.
+For most games and apps made with 4.0, it should be relatively safe to migrate to 4.1.
 This page intends to cover everything you need to pay attention to when migrating
 your project.
 
@@ -14,7 +14,8 @@ If you are migrating from 4.0 to 4.1, the breaking changes listed here might
 affect you. Changes are grouped by areas/systems.
 
 .. warning::
-    The GDExtension API completely breaks compatibility in 4.1 so it's not included
+
+    The GDExtension API completely breaks compatibility in 4.1, so it's not included
     in the table below. See the :ref:`updating_your_gdextension_for_godot_4_1` section
     for more information.
 

+ 4 - 0
tutorials/migrating/upgrading_to_godot_4.rst

@@ -532,6 +532,10 @@ break backwards compatibility due to different default behavior.
 
 The most notable examples of this are:
 
+- Lifecycle functions such as ``_ready()`` and ``_process()`` no longer
+  implicitly call parent classes' functions that have the same name. Instead,
+  you must use ``super()`` at the top of a lifecycle function in the child class
+  so that the parent class function is called first.
 - Both :ref:`class_String` and :ref:`class_StringName` are now exposed to
   GDScript. This allows for greater optimization, as StringName is specifically
   designed to be used for "constant" strings that are created once and reused