godotengine / godotengine/godot-docs

Setter function of exported property only called when the value is different from its default

Open
#8,246 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
reStructuredText
Stars
5.7k
Forks
3.8k
Avg merge
1d 20h
Merged PRs (30d)
25

Description

**Your Godot version:** v4.1.2.stable.official [399c9dc39]

**Issue description:**

See this [issue](https://github.com/godotengine/godot/issues/83375) for initial discussion. I though it was a bug.

It should be added that setter functions are not called on default values. If you want to implement some logic for default values, you should handle it on `_init` or `_ready` (and be compatible with non-default ones). Nodes have to be designed from default values.

As possible example, the initial [discussion](https://github.com/godotengine/godot/issues/83375) could be used.

**URL to the documentation page (if already existing):** https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/gdscript_basics.html#properties-setters-and-getters

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.