Variant get(property: String) const
Returns the Variant value of the given property. If the property
doesn’t exist, this will return null.
I think the error is because the searched property does not exist. If you use for example get (“active”) the function does not return null. Can you pass the tutorial link?
(Now that I look closely, what I said does not make sense, that the get function returns null is one thing and that the variable where it is executed is null is another)
Thanks for replying!
I tried a bit of debugging and commented out the second line. I added a print line in the ready function to print the animationTree object. The output showed a null object and then the animationTree! But the second line does not work when I uncomment it. Does this help in solving the problem?
fronquak | 2021-03-07 03:23
mmm weird, it’s like it waits for another node to load to stop being null. Take a good look at your entire project and the loading order. What animates with the animationTree? Maybe it animates some property that is loaded later in the scene? Go through all of that and if you still have errors try isolating the parts in new scenes or even a new project to find the source of the error.
estebanmolca | 2021-03-07 03:57
Another thing, the only way I see for ready () to print the same line 2 times is for that script to run 2 times. What does the script have in main?
estebanmolca | 2021-03-07 04:14
I am all out of ideas now. I removed every script and [object:null] still shows up.
EDIT: I deleted the Main node and it still shows up
fronquak | 2021-03-07 06:18
Do you have any script running in autoload?
If you switch the tab to remote with the game running, you will be able to see everything that is loading and the order, including any scripts that may be loading from autoload.
estebanmolca | 2021-03-07 10:52
That’s it, thank you so much! Can’t believe I forgot about autoload… Add an answer and I’ll mark it as solved. Thanks again
fronquak | 2021-03-07 11:15
No problem, I’m glad you found the bug.
estebanmolca | 2021-03-07 11:18