So the situation is this: There are 2 classes in different files, in class 1 I call a function from class 2, after which I get a 3 errors and the function does not work, while if the same function is called inside its own class, everything works fine, can you explain why this is so, and how do I solve this problem? P.s. if I replace GetNode with GD.Print("blabla") for example, everything works correctly
The object both have to be in the scene tree to use get node.
cybereality The problem has been solved. I will describe how I did it, just in case: After creating a new instance of the class, you need to add it to the scene tree with the help of AddChild(name), then, even if the node has a unique scene name (%Button for example), and if before you could do with GetNode<Button>("%Button"), then after the above actions you need to specify an absolute path, like this: GetNode<Button>("/root/Control/%Button") Thank you.
AddChild(name)
%Button
GetNode<Button>("%Button")
GetNode<Button>("/root/Control/%Button")