Преглед на файлове

Add docs for ignoring return value warning (#5756)

* Add docs for ignoring return value warning. Fixes #5753.

* Remove code change per feedback
Tres Henry преди 3 години
родител
ревизия
d076761cba
променени са 1 файла, в които са добавени 7 реда и са изтрити 0 реда
  1. 7 0
      getting_started/first_3d_game/04.mob_scene.rst

+ 7 - 0
getting_started/first_3d_game/04.mob_scene.rst

@@ -139,6 +139,13 @@ Similarly to the player, we move the mob every frame by calling
 the ``velocity`` every frame: we want the monster to move at a constant speed
 and leave the screen, even if it were to hit an obstacle.
 
+You may see a warning in GDScript that the return value from
+``move_and_slide()`` is unused. This is expected. You can simply ignore the
+warning or, if you want to hide it entirely, add the comment
+``# warning-ignore:return_value_discarded`` just above the
+``move_and_slide(velocity)`` line. To read more about the GDScript warning
+system, see :ref:`doc_gdscript_warning_system`.
+
 We need to define another function to calculate the start velocity. This
 function will turn the monster towards the player and randomize both its angle
 of motion and its velocity.