Skip to content

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Sep 19, 2025

@Calinou Calinou added enhancement topic:gdscript area:manual Issues and PRs related to the Manual/Tutorials section of the documentation cherrypick:4.5 labels Sep 19, 2025
@AThousandShips AThousandShips changed the title Document reading an exported property value's early on in GDScript exports Document reading an exported property's values early on in GDScript exports Sep 19, 2025

If you read an exported variable's value in :ref:`_init() <class_Object_private_method__init>`,
it will return the default value specified in the export annotation instead of the value
that was set in the inspector. This is because the inspector only sets the value after
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inspector never really sets any values here, so this is arguably misleading. The value is assigned by loading the file itself, unrelated to the editor

If you read an exported variable's value in :ref:`_init() <class_Object_private_method__init>`,
it will return the default value specified in the export annotation instead of the value
that was set in the inspector. This is because the inspector only sets the value after
the object is constructed. To get the value set in the inspector, you need
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:manual Issues and PRs related to the Manual/Tutorials section of the documentation cherrypick:4.5 enhancement topic:gdscript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants