All Questions


Rabbit One

What is the use of Built-in script?

As I understood, the variables written in this built-in script are available for all nodes in that particular scene. I think functions are as well available for other odes. Just like an Autoload script but for only this particular scene. Am I right?

But what is its scope? If we return to game.tscn, are this built-in script also available for nodes in game.tscn?

  • Nathan Lovato replied

    A built-in script gets saved inside the scene file (.tscn). That's it. It doesn't exist as a separate file on the hard drive. Using built-in scripts is nice for short files or very specific scripted events you may not want to see pollute your drive. They have one main limitation: the corresponding scene must be open to load and debug the script.