Skip to content

Commit 217bd3c

Browse files
GarrickWinterskyace65AThousandShips
authored
Updating the 2D tutorial in light of an editor bug (godotengine#7915)
* Update to the 2D tutorial Issue #41283 is currently disrupting the flow of the official 2D tutorial for folks with external script editors. This change is to update the tutorial to acknowledge this bug and provide newcomers with clearer guidelines on how to complete the tutorial despite the bug. It also clarifies a potential point of confusion about how the editor communicates connection between signals and script functions. Co-authored-by: Matthew <[email protected]> Co-authored-by: A Thousand Ships <[email protected]>
1 parent 5966ffd commit 217bd3c

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

getting_started/first_2d_game/03.coding_the_player.rst

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -372,14 +372,29 @@ Inspector tab to see the list of signals the player can emit:
372372
Notice our custom "hit" signal is there as well! Since our enemies are going to
373373
be ``RigidBody2D`` nodes, we want the ``body_entered(body: Node2D)`` signal. This
374374
signal will be emitted when a body contacts the player. Click "Connect.." and
375-
the "Connect a Signal" window appears. We don't need to change any of these
376-
settings so click "Connect" again. Godot will automatically create a function in
377-
your player's script.
375+
the "Connect a Signal" window appears.
376+
377+
Godot will create a function with that exact name directly in script
378+
for you. You don't need to change the default settings right now.
379+
380+
.. warning::
381+
382+
.. The issue for this bug is #41283
383+
384+
If you're using an external text editor (for example, Visual Studio Code),
385+
a bug currently prevents Godot from doing so. You'll be sent to your external
386+
editor, but the new function won't be there.
387+
388+
In this case, you'll need to write the function yourself into the Player's
389+
script file.
378390

379391
.. image:: img/player_signal_connection.webp
380392

381-
Note the green icon indicating that a signal is connected to this function. Add
382-
this code to the function:
393+
Note the green icon indicating that a signal is connected to this function; this does
394+
not mean the function exists, only that the signal will attempt to connect to a function
395+
with that name, so double-check that the spelling of the function matches exactly!
396+
397+
Next, add this code to the function:
383398

384399
.. tabs::
385400
.. code-tab:: gdscript GDScript

0 commit comments

Comments
 (0)