How to customize exported variable behavior

Godot Version

v4.4.1.stable.mono.official [49a5bc7b6]

Question

I’m trying to do stuff like auto convert an input number from deg to rad from the editor, or just customize behavior of them in general. How can I do that? I’m aware of function that is provided for these use cases, but the way they work is confusing to me. Thanks in advance.

The annotation @export_range() already has support to show the value as degrees in the editor but store it as radians in your exported variable.

Most common exports are already covered by the other @export annotations but if you need something more specific you can use the annotation @export_custom() which let you export a variable with custom settings.

If you need even more configuration or dynamic exports then you’ll need to use Object._validate_property() or Object._get_property_list(). Here’s an example on how to export the project’s input map actions Selector Plugin hinting issue - #3 by mrcdk

It worked, thank you!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.