Right Click to Aim

Hi, I’m pretty new to UE4, and currently working on a third person shooter game.

I was wondering how I might use right-click to move the camera to the side of the actor, and take input from the left mouse button only when the right mouse button is being held. Can anyone help with this? Thanks!

Hi Sariedron.

Your question is covered by many tutorials out there, I’ll cover the very basic stuff to give you a way-to-go.

On Edit → Project Settings → Input.
Add two action Mappings for Left and Right Mouse clicks, we need this to know when the player presses the those buttons.

This video will give you an idea on how to work with more than one camera and how to ‘jump’ from one camera to another: UE4 Blueprint Tutorial 02 - Character Select Screen - YouTube

On your character blueprint, use the pressed input event for the right mouse to move the camera and set a boolean variable like ‘IsHoldingRightMouseButton’ to true.
Use the released event from the right mouse to move back the camera and clear the boolean variable.

When the left mouse is pressed, check if the boolean variable is true.

I hope this small guide helps you,

Thanks! This is exactly what I was looking for.