0 votes

Tl;dr: is there a way to know which node consumed the mouse click event?

Rational: In my game I'm using multiple canvas layers, viewports, pauses, etc and I'm facing repeating situations in which I click on a node - but the node doesn't react. I assume someone else consumed the click event. Is there a way to trace it?

Godot version 3.2.3
in Engine by (138 points)

That would be useful
I don't think there's a way but I hope I'm wrong
until then I'm using print()s and guessing :/

1 Answer

+3 votes

In the debugger, there's a Misc tab that has "Clicked Control". This only works for Control nodes, though. If it's not a Control node that's consuming the event, you can follow this diagram to see what node is. The only nodes that can consume the event before a Control node are nodes with _input functions, so you can look for nodes that have those.


The diagram is from this article.

by (7,336 points)

Thank you, I didn't know about this debugger tab.
I ended up using print calls to follow the diagram.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.