can an instanced script get the current scene name

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By newusername

i’m using a referenced scene with a script that is requesting the scene name via get_tree().current_scene.name but it is just returning with Node2D.

Im on version 3.3.2 stable and the script is in the root node of the referenced screen if it makes a difference

:bust_in_silhouette: Reply From: Yaroslav_Fox

Try this

print(get_tree().current_scene.get_name())

i currently have it set to a keybind.
it returns Node2D as the only output

newusername | 2021-08-04 09:59