Godot Version
4.2
Question
Hello folks!
I’m working on procedural terrain plugin for Godot 4.2.
So far so good, however I’m stuck with editor tool stuff. I have different parameters @export
ed to the editor. Since the terrain is procedural, ideally I would like to pass some Callable
to my node. I can do it via code, but I would like it to be configurable via editor as well.
If I make it like this:
@export height: Callable
then I get disabled control which is useless (see this thread).
As a temporary workaround, I created a Node
parameter:
@export var height_node: Node
So I create some node with a script containing a get_height
function, and inside my terrain’s code I call it like
var height = height_node.get_height(x, y)
It works but looks ugly, so I was curious whether there is some better / canonical approach to set a callable as editor parameter.
Thank you!