Mouse button events work inside the controller but not inside the player

I have the following mouse button events:


If I place them inside the controller, everything works fine. But inside the player, they do not work. I have enabled input on the player, the mouse cursor is visible, “EnableClick Events” in the controller is set to true and “BlockInput” to false. What can be the problem? Which additional information should I provide?

Is the pawn possessed? Also, if you place the same input in both the Controller and the Pawn, only the controller will process it due to consumption rules - by default at least.

You shouldn’t be enabling controls on the player pawn.

The player controller should be responsible for player input. It should then relay the commands to the possessed pawn.

Yes.

The input was earlier placed in the controller, but now I have removed it from there.

Enabling input and enabling controls aren’t the same?

How to do this?

The player controller should initialize the enhanced input context mapping. It should then posses a pawn either though the game mode automatically (default pawn) or though the for instance thought the post login function.

Both are done.

This works as is. You have an issue elsewhere. Possessed pawns process input by default, there’s no need to enable anything. Unless it gets consumed early by someone else:

As you can see, Pawns get to the input rather late :point_up_2: . You can disable consumptions:

But I wound not recommend it.

No, you are calling the old input functions. You should setup input actions that hook into the mapping context

But how to find where?

I do not need the input actions in this case, just a reaction to the mouse button click.

Find other places where you’ve placed:

Note the Enhanced Input will also consume it.

Only in the player and in the car, but the second also doesn’t work.

Well, if the car is an input-enabled actor, it will eat the input early:

That’s why enabling input on actors is the equivalent of shooting yourself in the foot. But! Sometimes you may want to have the LMB to fire in many places because reasons.

Now everyone else can enjoys clicks as well. Not that this will make debugging input a royal pain in the neck.

Add a print string on left mouse button for each place where you used it and see which fires.

Your controller probably consumes the input not letting the other actors use the buttons just like @Everynone says.

Controller consume unchecked

Pawn

Left click in game
obraz

1 Like

Do the check such as WasMouseButtonJustPressed etc. also consume input?

No.

I do NOT have mouse button events in the controller.

I have added a break point, it is worse?

obraz

Then check where it is

obraz

Breakpoints work too. Just be sure an old forgotten bp isn’t consuming it somewhere in the background.

I have checked. Only player, car and a character from the pack that is not present in the current level.

Did you turn off auto receive input on the pawn? It’s not needed if it’s possessed. (should be disabled)

example of the pass through non consumed.
clickproj.zip (25.6 KB)