Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify Area2D warning behavior #10173

Merged
merged 2 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.