Skip to content

Explain that @export loads Resources when script instances are loaded #9903

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions tutorials/scripting/gdscript/gdscript_exports.rst
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,17 @@ It must be noted that even if the script is not being run while in the
editor, the exported properties are still editable. This can be used
in conjunction with a :ref:`script in "tool" mode <doc_gdscript_tool_mode>`.

.. note::

Using ``@export`` variables for :ref:`Resource <class_Resource>` objects
makes them a dependency of the script, meaning that all the resources
referenced by ``@export`` variables are loaded when the scene
containing the script is instantiated. If you want to reference a
:ref:`Resource <class_Resource>` object but load it manually when you need
it (which, for example, is often the case for
:ref:`PackedScenes <class_PackedScene>` containing a whole level), use
``@export_file`` instead.

Exporting bit flags
-------------------

Expand Down