# Disable exported variable on the editor

**URL:** <https://forum.godotengine.org/t/disable-exported-variable-on-the-editor/25698>\
**Category:** Archive\
**Created:** [January 14, 2019, 4:23am UTC](https://forum.godotengine.org/t/disable-exported-variable-on-the-editor/25698 "2019-01-14T04:23:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://forum.godotengine.org/uploads/default/original/2X/4/4b0a7fa8a6334634b94a13d421f0d99e6f04e21f.svg) [@system](https://forum.godotengine.org/u/system)\
**Post date:** [January 14, 2019, 4:23am UTC](https://forum.godotengine.org/t/disable-exported-variable-on-the-editor/25698/1 "2019-01-14T04:23:54Z")

</div>

| | | |
| --- | --- | --- |
| ℹ | **Attention** | Topic was automatically imported from the old Question2Answer platform. |
| 👤 | **Asked&nbsp;By** | fpicoral |

Is there a way to disable (like read only, edit=false or something like that) an exported variable on the editor to avoid that:  
 ![enter image description here](https://i.imgur.com/aavz9Hz.png)

---

<div class="post-metadata">

**Author:** ![system](https://forum.godotengine.org/uploads/default/original/2X/4/4b0a7fa8a6334634b94a13d421f0d99e6f04e21f.svg) [@system](https://forum.godotengine.org/u/system)\
**Post date:** [January 14, 2019, 1:52pm UTC](https://forum.godotengine.org/t/disable-exported-variable-on-the-editor/25698/2 "2019-01-14T13:52:37Z")

</div>

| | | |
| --- | --- | --- |
| 👤 | **Reply From:** | Zylann |

I don’t think there is an explicit way to make a variable read-only in the inspector, but you could try giving it a getter and a setter, where the setter simply does nothing, which would prevent edition of the variable. Problem is, I think it will also prevent it from being set too when the scene is loaded. This could be worked around by checking `is_inside_tree() and Engine.editor_hint`, because variables are set before the node is added to the tree. So if the node is in the scene tree AND in the editor, its value can’t be set. This is all workarounds so it may or may not work as you expect depending on the use cases you have.

On the other hand, if you just want to HIDE that variable but still have it saved in the scene file, there is another approach: don’t use `export`, and override `_get_property_list()`, `_set()` and `_get()` to specify flags manually, like shown in this issue: [Ability to export a variable without showing it in the inspector · Issue #5988 · godotengine/godot · GitHub](https://github.com/godotengine/godot/issues/5988)
