I’m seeing a bunch of these errors int he debugger when the game runs
E 0:00:13:627 emit_signalp: Error calling from signal 'gui_input' to callable: 'Control(Action.gd)::_on_gui_input': Cannot convert argument 1 from Object to Object.
<C++ Source> core/object/object.cpp:1406 @ emit_signalp()
which I THINK are triggered by this piece of code:
func _on_gui_input(event: InputEventMouseButton) -> void:
if event.button_index == MOUSE_BUTTON_LEFT and event.is_action_released("click"):
do_something()
But I have no idea how to debug it and the app seems to run normally when I left-click on that Control
The source triggering it seems to be this:
It’s just annoying because it’s flooding the output with those messages and it makes it tricky see the actual output I’m after.
func _on_gui_input(event: InputEvent) -> void:
if event is InputEventMouseButton:
var mouseEvent:InputEventMouseButton = event as InputEventMouseButton
if mouseEvent.button_index == MOUSE_BUTTON_LEFT and mouseEvent.is_action_released("click"):
It’s not necessary to check if a type conversion is possible using is before making the actual conversion with as. If the type conversion is not possible, as operator result is null.