Skip to content

Unclear step in "Connecting a signal via code" guide #8169

@GrassWarlock

Description

@GrassWarlock

Godot 4.1.2
Edit (2023/12/30):
It seems the issue wasn't with the screenshot but with a lack of clarity on an important step in the tutorial.
This issue should now be resolved by just making sure to remind the reader to set node2d as the main scene before running the game. This allows the timer in Node2d to work without any issues.

=========
original name for this issue: Misleading screenshot in "Connecting a signal via code" guide

New to Godot but this might be a bug in the Godot engine itself:
The guide tells you to add a Timer node as a child to a Sprite2D node.
If you do it the way the guide's screenshot shows (add from within the node_2d scene and not from the sprite_2d scene itself), you get an error telling you the timer node wasn't identified as a child to sprite_2d.
E 0:00:00:0557 sprite_2d.gd:12 @ _ready(): Node not found: "Timer" (relative to "/root/Sprite2D"). <C++ Error> Method/function failed. Returning: nullptr <C++ Source> scene/main/node.cpp:1626 @ get_node() <Stack Trace> sprite_2d.gd:12 @ _ready()
If you do it inside the sprite_2d scene itself, it works.

URL to the documentation page:

Proposed Solution:
This issue should now be resolved by just making sure to remind the reader to set node2d as the main scene.
if this is intended engine functionality, just change the screenshot to show you adding a child node from within the sprite_2d scene itself and not the general node_2d scene

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:getting startedIssues and PRs related to the Getting Started section of the documentationbug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions