Export property hints in Godot 4

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By sirdorius

How to use the export with type hints for the editor in Godot 4?

This is the old syntax for Godot 3:

export(int, LAYERS_3D_RENDER) var layers_3d_render

What is the equivalent for the new version?

:bust_in_silhouette: Reply From: RandallCurtis

In Godot 4, exports use the “@” annotation syntax. For 3D render layers the annotation is @export_flags_3d_render. You can view the full list and examples on the ‘latest’ docs version at @GDScript — Godot Engine (latest) documentation in English. The exports tutorial has been updated as well: GDScript exported properties — Godot Engine (latest) documentation in English

Thanks, this worked

sirdorius | 2022-11-05 18:56