Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Corruptinator | |
Old Version | Published before Godot 3 was released. |
Hello! I am currently working on another game project and I like to ask if there is any other way to access an another Node’s GDScript to access the variable or property?
For example, I am working on an elevator, there are two objects, one is the Area2D Object with GDScript that allows the object to move out of the elevator and a Switch Object with GDScript as well that activates an animation and triggers a Variable boolean function to tell the Area2D not to let the player out until the animation is done.
Now this is where the “Switch” GDScript needs to access the Area2D’s GDScript, where it can access the Variable to tell the player when to exit the elevator or not.
Is there any way whatsoever to let an object tap into another object’s variable script?
There are many way to do this, but the question for me is: what is the most manageable way to do this.
I don’t like to have many “get_node” calls with paths who can be broken during developpement time. So I’m testing an autoload script who handle node paths automatically.
For the moment my script doesn’t work. My signals connects functions fails because the first entered nodes try to connect to nodes who aren’t entered yet.
I need to catch a signal who warn the script that the scene tree is complete.
DriNeo | 2016-03-21 10:00