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 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.
answered Jun 15 '16 at 04:19 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here