Player Camera Rotation by Mouseclick / Mapping Problem

Hi everyone!

I´ve got a little problem regarding my Cameramovement of my first Person Character.

Setup:
I want to rotate my Camera while pressing the left mousebutton.
In the FirstPersonCharacter-Blueprint, it seems to be an “EnhancedInputAction IA_Look” controling that.

Issue:
The problem is, the right mouse button is triggering that cameramovement as well and I cant find an actionmapping or something like that, which binds the mousebuttons to that InputAction.

// I found a comment regarding that, which says: “you should add a new input action for LMB and on press set a variable to true and on release to false. Then on your mouse move action before changing the camera check if your variable is set to true (LMB is down).”
…I tried to play around with that and also created an “InputMappingContext”, but could not make sense of that.

Does anybody has an idea how to fix that?

Thank you for any help!
Best, Peter


1 Like
  • create a new Input Action and assign it to the LMB in the Mapping Context:

image

  • in the IA_Look, add a Trigger - Chorded Action:

image

Assign a new Chorded Action. No script is needed.

Hi! Thanks for the fast reply!

Do I have to set up something inside the new Input Action? Or I missed something?
I also changed the “Value Type” of “IA_HoldLookLMB” to "Axis2D (vector2D), but right now, I cant move my camera anymore.

Big thanks and best,
Peter

Should be left at default - digital.

I set it back to digital. But same thing, I cant look around anymore.

In IMC_Default, I changed the input to “right Mouse Button” for a test and it works. I can look around with the right mouse, but not with the left.
I just need it to the other way around :slight_smile:

Thanks again for helping me!
Best,
Peter

Chances are something else consumes input. What else is LMB used for? Another mapping context with higher priority perhaps? A leftover experiment from before?

Finally, I found It! After hours of searching :sweat_smile:
The Mouse was consumed by another widget :exploding_head:

Your solution works perfectly now!

Thanks so much!
Best
Peter

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.