Skip to content

Commit

Permalink
Clarify Area2D warning behavior (#10173)
Browse files Browse the repository at this point in the history
* Clarify Area2D warning behavior

* Apply suggestions from code review

---------

Co-authored-by: tetrapod <[email protected]>
  • Loading branch information
2 people authored and mhilbrunner committed Nov 30, 2024
1 parent 3eb1469 commit 032be9e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions getting_started/first_2d_game/02.player_scene.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,16 @@ what the object *is*. Click the "Other Node" button and add an :ref:`Area2D

.. image:: img/add_node.webp

Godot will display a warning icon next to the node in the scene tree. You can
ignore it for now. We will address it later.
When you add the ``Area2D`` node, Godot will display the following **warning icon**
next to it in the scene tree:

.. image:: img/no_shape_warning.webp

This warning tells us that the ``Area2D`` node requires a shape to detect collisions or overlaps.
We can **ignore the warning temporarily** because we will first set up the player's visuals
(using an animated sprite). Once the visuals are ready, we will add a collision shape as a child
node. This will allow us to accurately size and position the shape based on the sprite’s appearance.


With ``Area2D`` we can detect objects that overlap or run into the player.
Change the node's name to ``Player`` by double-clicking on it. Now that we've
Expand Down Expand Up @@ -98,6 +106,9 @@ When you're finished, your ``Player`` scene should look like this:

.. image:: img/player_scene_nodes.webp

Once this is done, the warning on the ``Area2D`` node will disappear, as it now has
a shape assigned and can interact with other objects.

Make sure to save the scene again after these changes.

In the next part, we'll add a script to the player node to move and animate it.
Expand Down
Binary file not shown.

0 comments on commit 032be9e

Please sign in to comment.