I am following the basic tutorial to https://docs.godotengine.org/it/4.x/getting_started/step_by_step/signals.html#complete-script with the only difference being that the button toggles the ability to move with arrows rather than acting on automatic movement.
In image I show the error I get, shown in two different panels.
At the suggestion of the tutorial I renamed the timer. But even using "Timer" the problem remains.
Occasional If you set a breakpoint in your _ready function and look at the remote scene does your timer node show up? Maybe it gets deleted for some reason or is not yet in the scene tree.
The error message says "relative to /root/Sprite2D", and not "relative to /root/Node2D/Sprite2D", which means that it's in reference to a scene tree other than the one shown.
That could happen if you added Sprite2D as an autoload in Project Settings. It could also happen if you added Sprite2D as a child of /root at runtime.
As Toxe suggested, looking at the runtime scene tree in the Remote tab should help.
https://docs.godotengine.org/en/4.2/tutorials/scripting/debug/overview_of_debugging_tools.html#remote-in-scene-dock
I checked the remote scene and the Timer is missing there. Sign that I attached the script to the wrong scene.
Is it normal that I had to manually set to show the remote scene hierarchy?
While debugging the app execution went to not respond.
I will have to do the tutorial all over again.
I'm coming from Unity, with over 10 games made, and getting locked into the initial tutorial because it's not clear where I'm working is not very nice!
I think it depends on the fact that everything here is a scene.
Occasional Is it normal that I had to manually set to show the remote scene hierarchy?
Yes but there is an option to show it automatically when running your game:
Editor Settings --> Debugger --> Auto switch to remote scene tree
Occasional getting locked into the initial tutorial because it's not clear where I'm working is not very nice!
I did both tutorials months ago and as far as I remember never had any issues. But if you think they could be worded better feel free to suggest changes for the docs.
© 2022 - 2024 — McMap. All rights reserved.