My node path is a period?

Godot Engine v4.2.1.stable.official.b09f793f5

So for the life of me I can’t figure out why my node path is literally just a period… yeah just .

I copy and paste the node path but in all situations pasting it only returns a single period and it’s really frustrating because it is making my get_node() not work because obviously the node path being a single . makes it literally inaccessible by any means other then directly dragging it onto the scene in editor…

I’ve gone through all of the code (which isn’t much, im trying to learn how to make asteroids) and there is absolutely no var that could even come close to changing the node path since the only time it is ever mentioned in any code is in a preload var.

I feel like I am close to actually learning something (and honestly am learning a lot) but then I come across an issue like this that really confuses me because it seems to be for no reason at all as well as the very little information about it all.

(I had to make a repository to show the code since i get 422 error trying to upload more than one picture here)

remember that path is relative from which script, if you do the usual drag drop
it’s full stop or just $"." because you are dragging drop the exact node attached with this script showing in the editor

check the example how to read the nodepath

I tried drag dropping the node onto other scripts, even ones not attached to anything and still get the singular “.” , even tried brand new scripts but nothing which was expected there but I’m just so confused as to why I can’t reach the path for my scene root node?

My issue is that I can’t get a path to the node for reasons that seem very arbitrary and I’m sure there is a reason, probably in logic why but I haven’t gotten that far into coding yet so my experience with the language of it all is limited.

I don’t understand at all because I can drag drop the path from every other node in my project except the exact nodes I actually need to path to. For future reference, I wasn’t even drag dropping the paths, I just tried that in bug hunting and realized that the path for the node feels like it’s non-existent.

Is it because root nodes don’t have paths? Because that’s certainly what it feels like…

try make the node access as unique name (right click the node and select Access as Unique Name) and just drag and drop it, if you want to see it with name in it

There is no option for unique name in the pull down menu…

I can access as unique name for any other node other than the root nodes in all scenes and I don’t understand why that is the case here…

mind that it’s just unique name, to actually reference without having headache about the correct nodepath, use @export var node:Node and just drag and drop the node there
use the variable node to what you need in the script code

also it seems like you are trying to access other scene’s script from really separate scene in editor
use signal to communicate instead

it would seem that the method i was trying to use simply just doesn’t work anymore due to the root node of any scene no longer being accessible through $paths. I had to revert the code back before any of the branching signals and force use the signal functions in the Signals tab(by default next to your node tab, somewhere top right of the window.

In other words, connecting branching signals via code is all done using the built in engine features.

not really sure entirely but I’ve fixed it and end up getting to crop a few lines out even so it would seem that it leans towards optimization at the cost of a stricter language.