@export with no type

Godot Version

4.3

Question

Is there a way to use the @export annotation, but not give it a type?

I have a “Stat” resource for my game and I wanted to be able to use any type when setting it, but to be able to modify it in the editor, is there a way to do this?

No, and that even make sense if you think about it, if you don’t have a specific type, what you expect the editor shows for you when you try to set the variable? If is a String you need the LineEdit to put the text, if is a int/float you need the SpinBox, if is an Array needs to show all the info about the array size and how to set the values, etc.

1 Like

thanks

An alternative for your case is use an Array with size 1, that allow you choice the type of the element you’ll put inside the array.

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