How do I debug where my mouse clicks are going?

I have a game with two modes - UMG menu mode, and camera mode. When I switch to camera mode, I Set Visibility to Hit Test Invisible for the main UMG UUserWidget and for the canvas panel, and most (not all) of the other UMG widgets are set to Hidden. In camera mode, normally I am able to left mouse click on an actor and the clickable actor receives the left mouse click event NotifyActorOnClicked().

However, if I left click somewhere other than the clickable actor, then left click the actor, the actor does not receive NotifyActorOnClicked()… Unless I double-click. Or if I toggle from camera mode to UMG menu mode then back to camera mode.

From print statements I was able to determine that the click that breaks stuff is picked up by my player controller which is connected to a pawn. The pawn’s MouseLeftDown() is called then because it’s SetupPlayerInputComponent() used UInputComponent::BindAction() to set the pawn’s MouseLeftDown() as the event callback for mouse left down. After this click (that breaks stuff), I no longer no where my mouse clicks are going. Neither my pawn’s MouseLeftDown() is called nor the UMG widget’s mouse left down are hit. Note that even after the click that breaks stuff, double-click still works (by “works” I mean I can click an actor and trigger it’s NotifyActorOnClicked()).

So how can I telll where my mouse clicks are going? Is there some debug trick to do this?

One theory I have is that maybe setting the parent UMG widget’s Visibility to Hit Test Invisible is not enough - maybe I have to do it for each an every UMG widget?

(Aside - I have like 100 of them, which is one of the reasons visual scripting like Blueprints is less efficient than editing actual text code - which is why I hope Unreal will someday allow a mode where you can edit Blueprints s text.)

My question says “how do I debug”, but another way to word my question is the following. I have two modes - Set Input Mode Game Only and Set Input Mode UIOnly. When I’m in Game Only, I can click an actor to trigger NotifyActorOnClicked(). But left mouse clicking on nothing (or on other actors) somehow breaks this ability. It might have to do with UMG (widget visibility?) (UIOnly vs. Game Only?) but I’m not sure.

I’m not sure if this is a bug report, C++, or Blueprint question.

thank you for any help, ideas, or leads on this

I think I’m having a similar issue as you and I can’t figure it out myself.

Using the Top-Down level, I implemented a firing system where when you hold the mouse button down, a charge begins and is clamped at a certain value. Then upon release that value goes through some logic to give an initial velocity to the projectile. It all works as intended.

The problem comes when I set my Input Mode to Game Only. I can fire normally for one time and one time only. After that, the mouse button doesn’t trigger anymore. However, the mouse button release does work, as the projectile falls to the ground because I’m unable to provide any charge since the click doesn’t work. I can however double-click and hold and the mouse button down will then trigger.

I do have a HUD but other than that I’m not activating any sort of UMG for this to happen. If I don’t mess with any of the “Set Input Mode” nodes everything seems to work fine as far as firing the projectile goes. I’m using solely Blueprint.

I put in a c++ debug for this. Not sure if there already is a setting in the blueprint system for it. I couldn’t find it so I just made one.

In the base widget class I added a watcher that fires when a click is consumed, printing the widgets display name.

There is something called a “Widget Reflector” that can be activated with ctrl+shift+W.

It didn’t help me with my issue and I’m not sure if it’s what you’re referring to but I thought I’d point it out nonetheless.