I am using the LeftMouseButton event in the player controller, and trying to build off of it. None of my functions have been triggering properly, and in looking at the debug I realized that the “released” pin was always firing, but the “pressed” pin fires only every other time or every third time the button is pressed. If the mouse button is held down longer than the double click time, the “pressed” pin never fires.
As far as use case goes, I was trying to create a drag select box, but after going through my own efforts, and then directly copying 2 different “how to” blueprints with no results, I started digging a bit deeper than “maybe this isn’t hooked up right.”
Is this normal behavior? Is there something going on that I am not seeing? I moved this into the PlayerController blueprint because the left mouse button event doesn’t fire at all in the hud blueprint.
You have the mouse button event in another BP. You need to set both of them to ‘consume event = false’. ( it’s in the detals panel of the mouse event ).
Thanks for the help attempt!!! I went through all my other blueprints (project is still quite sparse) and there are no other instances of left mouse button. I did set this one not to consume the event, and then for good measure did the same for all mouse events. The problem persists
After tinkering with this again, even going so far as to delete all other blueprints from the project and only have this one but still experiencing the issue, I replicated the blueprints from scratch in a freshly opened project. It doesn’t do it in the new project. I am at a loss, but as long as it works in the new one
Out of curiosity I used print string on the mouse button event. “p” for pressed, “r” for released. In the old project, if I play the sim and then click the mouse button several times it looks like this -
-r-p-r-r-p-r-r-p-r-r-p-r-repeating
In the clean project, literally the same blueprint set up the same way, it prints p-r-p-r-p-r like you would expect from press+release.
I am at a loss. The only thing I can think of is that, in learning how to do the things, I spent some 16-20 hours digging through everything I could find and clicking things to see what they did. Somewhere down deep where I don’t remember to look, I probably hit something that caused this behavior, but I can’t for the life of me figure out what it is.
Issue not solved, but at least circumvented. Thanks for the read and attempt at assistance.
I think you will ( might ) find it in the end. I often think the engine is playing up, and then eventually I realise it’s just my brain and the engine is doing exactly what I asked it to…
Did you happen to find a solution to this? I am having the exact same problem. The initial mouse button press is not registered but the release is. If you wait a half second between mouse clicks it registers the pressed event. It also doesn’t matter which mouse button it is. I am running the latest 4.24.3 build of UE4. I don’t think I’ve changed anything related to the mouse settings other than adding the action mapping.
Funny enough immediately after my previous post I found the solution to my problem. In the begin play of my custom HUD class I was setting the input mode to Game Only. Removing this node corrected the behaviour.
I’m experiencing this issue. I’m new to using blueprints. Normally what I’d do in a C++ program is try to trace execution, is there a way to do this to figure out why LMB Pressed events aren’t registering?
I’m also experiencing this, and the “input mode” cannot possibly be the reason for it… how would you otherwise ever be able to hold down a button to rapid fire in a game? (Please don’t tell me that this requires C++)
EDIT: Experimenting with a fresh project, it seems that you MUST capture the mouse to get pressed events (if you don’t, you only get that weird on release behavior). If you capture the mouse but always show the cursor in the player controller’s default class settings, the behavior seems indistinguishable from not capturing the mouse…
Ok so I’ve been confronted with the same problem. At first I thought I maybe had a Widget that was “Visible” and consuming the click but after looking at all of them everything looked in order. So I had to dig deeper.
Apparently the problem is not “Set Input Mode Game Only” in itself, BUT the fact that using this node will automatically change the “Viewport Mouse Capture Mode” from “Capture During Mouse Down” to “Capture Permanently”.
And like it is explained when hovering the various Mouse Capture Mode enums, Capture Permanently WILL CONSUME the Pressed trigger but not the Released trigger.
Hope that helps. It was really a hair pulling problem for me, especially since it’s not written clearly anywhere that this automatic toggle is happening in the background when using Set Input Mode.