Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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!

Product Version: UE 4.7
more ▼

asked Jan 21 '16 at 12:02 PM in Blueprint Scripting

avatar image

3 1 2 3

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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: 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,

more ▼

answered Jan 21 '16 at 03:10 PM

avatar image

480 25 8 30

avatar image Sariedron Jan 21 '16 at 06:36 PM

Thanks! This is exactly what I was looking for.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question