I have a script's source that I will need to extract variables from. I have to do it in this way due to an implementation detail. Here's what I did:
var script = GDScript.new()
script.set_source_code('var test_var = "hi this is working"')
var my_object = Node.new()
Then I do:
print(my_object.test_var) #I get an error! Doesn't work :(
Why doesn't it work? What am I missing here? I tried using Reference.new() but still doesn't work!