load() doesn't work when grabbing the path to the tscn file from another node

Godot Version



OK, so if I do this:

path = “res://path_to_file”


it returns a PackedScene

what I am trying to do is:

path = get_parent().string_variable_in_parent


and it returns Object#null

I’ve printed the path variable, and it is indeed a string representing the path to the correct tscn file, so not sure why it doesn’t work with the second…

You’ll have to give us a bit more to work with. Your scene tree, for one. What does get_parent() print and get_parent().string_variable_in_parent. Are you sure string_variable_in_parent is a valid variable? etc.

Hey, thanks for the comment - I was out of town for a bit. I figured out my problem…my path variable was formatted incorrectly!