Godot Version
v4.5.1.stable.official [f62fdbde1]
Question
I an attempt to easily modify member variables of a node at runtime for debugging purposes without having to mess around with an Input system or extra UI Systems I’d have to implement, I attempted to use a tool button, which I tried to activate during runtime through the remote scene tree.
Here is the minimal setup I tried:
@tool
extends Node
@export_tool_button("Hello World", "Callable") var action: Callable = function
func function() -> void:
print("Hello World")
It works fine in editor, but as soon as I play the scene, navigate to the remote scene tree, select the node in question and try pressing the button an error is thrown.
ERROR: Tool button action “null::null” is an invalid callable.
I suspect that it might be the expected behavior (tool buttons being meant for editor only), if so a confirmation would be nice.
If not why does this happen and how can this error be avoided?