_unhandled_input in TileMap is not handling events

Godot Version

Godot 3.2.3.stable

Question

I’m making a simple sliding puzzle. The puzzle itself is implemented with a TileMap. Besides that, the game only has a reset button and a victory label. When the TileMap is mouse-clicked, the clicked tile is slid to the open space. If TileMap handles the input using _input(event), the game works as expected. However, I’ve read in the docs that _unhandled_input(event) is preferred for gameplay input. When _input is changed to the new method, input is not handled anymore.

Logging shows that _unhandled_input does not receive the event at all. At first I suspected the reset button node was somehow capturing the input (even though that’s not where the click is, and the button has no script), so I removed the button. But the outcome is the same.

You shouldn’t use Input in these methods, you should use the event instead

1 Like