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!
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: https://www.youtube.com/watch?v=PQ3dctySTTU
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,
Follow this question
Once you sign in you will be able to subscribe for any updates here