Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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

Product Version: UE 4.12
more ▼

asked Jun 12 '16 at 03:44 AM in Blueprint Scripting

avatar image

72 12 15 17

avatar image Rufio2031 Jun 15 '16 at 02:11 PM

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

more ▼

answered Jun 15 '16 at 04:19 PM

avatar image

351 7 5 32

avatar image Rufio2031 Jun 15 '16 at 04:25 PM

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question