Left (or right) mouse button does not work

Even with this simple execution below placed within the character blueprint doesn’t work. Is there some setting somewhere that I might have accidently disabled? Keyboard events work fine, just not mouse events. The axis do work, as in I can look up and down and left and right with the mouse. If there’s an answer somewhere else, can you please link me to it?
Thanks
EDIT: I launched in a separate process. When I clicked out of the process, it detected the mouse clicked and printed the string, but when I clicked in the process, it did not print the string. I have not been able to duplicate this event again. EDIT2: This execution works in other projects, but not this one. I tried making a completely clean gamemode, pawn plus the left mouse button execution shown below, and player controller, but it still doesn’t work.
EDIT3: I don’t know if this will help, but I’ve assigned left mouse button and a keyboard button to my action mapping. The keyboard button works but the mouse button does not. EDIT4: Left mouse button works on other projects, but not on this specific one.

You probably just need to enable Input first.

You mean do this?

This doesn’t work either.

No. Like this :

Event Begin Play > Enable Input

Left Mouse Button > Print String

You cant enable the Input via an Input, because you cant execute the Input without Input being enabled.

1 Like

It still doesn’t execute, but thanks for offering a possibility.

It should look like this:

I have it exactly like that.

Hello, nogdoesrandomstuff,

Check on your Player Controller that you have “Enable Click Events” checked on the Mouse Interface tab.

100779-blueprint4.jpg

When I create a new player controller blueprint it seems to be off by default.

If you are getting other input events like keyboard presses on the same blueprint, then your input is already enabled, so that isn’t the problem.

1 Like

Look in the logs, the print string might show up there.

Unfortunately no, other strings show up from different print strings, but this doesn’t.

I created a new player controller, enabled click events, and assigned it to my game mode, and it still isn’t working. Maybe I missed a step?

Is the mapping Left Mouse Button assigned? Try deleting the mapping there and try to create it again, see if that works.

I just tried this and it works on my end, so it is strange. I am using the Left Mouse Button event node like in your image (no need to assign an action mapping) and it works.

Here is how I have it set up:

On my player controller, I am using a newly created controller blueprint, without any functionality added and everything in its default values. Here is how it looks like.

100877-blueprint5.jpg

You will notice that the Enable Click Events checkbox is unticked because it is not actually needed to just hear the left and right click events.

I also created a new Pawn, that will be my default pawn, and a new Game Mode. On the Game Mode, I didn’t do anything except pointing it to my player controller and my pawn.

100878-blueprint6.jpg

And on my testPawn, this is the functionality I added.

Lastly, I made sure that I have my game mode set so I am actually using it.

The event is firing as expected. All of this is working on a clean project, so it might be that there is something else on your project that is obstructing with the events.

Now, all of this should work well to just hear the mouse clicks. If you are looking for more elaborate mouse functionality like doing a mouse over on objects or clicking on an actor, that is where those checkboxes on the player controller matter.

Here is a forum post that fixes mouse events for someone that was trying to mouse over and click on a pawn.

Do you have any suggestions on what might be obstructing the events that I can check?

No, to be honest. You might try to assign the click button as an action mapping on the input tab in the project settings (ej. for the action “Fire”) and check if that event fires. Similar to what StoianAlina suggested.

An action mapping shouldn’t be necessary here, but since for your blueprint an action mapping event is origin-agnostic and it is unreal on the back end managing the mouse event and routing it as an action event, maybe in this case that doesn’t fail?

Worth a try.

That was actually the first thing I did. I just tried it again and it didn’t work. I’m getting desperate, should I report this as a bug? (Maybe I’m overreacting but nothing seems to be working)

I think you have to assign the Left Mouse button first. In : Edit > Project Settings > Input (in the Engine section), then go to Action Mappings, click on + and add the Left Mouse button, and name it whatever you want(such as “Fire”). If it’s not that I don’t know !

Try it on a clean project first. Then try it on your project but with a clean game mode. Then with a different pawn that only has the click functionality (make sure that it is actually spawning). Etc.

Try to isolate what it is in your project that is affecting the result. After you have it, then you can check the settings or functionality of the offending object.

But go from the clean project first. Make sure that whatever version of the engine you are using is working as expected. And then build over it until you break it and you know what did it.

Do you have this in your character blueprint?

If you mean the execution from the picture above, yes.