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"

Setting Mouse Buttons As Movement

Hello all,

I want to set my game so that when i press both mouse buttons it moves the character forward ive messed around with this for ever and cant figure it out even looked through the forums and YouTube and not a single answer!

I tried making a variable and calling it somehow but no idea how to get it to work!

And or id appreciate how you have two controls under one axis mapping!

alt text

Product Version: Not Selected
more ▼

asked Oct 06 '14 at 04:30 AM in Blueprint Scripting

avatar image

6 1 3 6

(comments are locked)
10|2000 characters needed characters left

3 answers: sort voted first

Not a proper solution, but something you could try: create an Axis binding named 'MouseMove'. Add two inputs for this binding. Set leftMouseButton with a weight of 1.0 and Right mouse button with a weight of 1.0. Now in your event graph, create a node for 'Event MouseMove'. Check that Axis value. If it is > 1.5, then that means both buttons are pressed; and you could proceed to move the character.

more ▼

answered Oct 06 '14 at 08:01 AM

avatar image

3.3k 154 50 271

avatar image Jyoji Oct 07 '14 at 05:58 PM


You good SIR are a magician!

You saved me hours of pain and suffering trying to figure that out, And thank you to everyone else that tried helping me out!

How it now looks for everyone else looking for the answer.

alt text

avatar image mindfane Oct 08 '14 at 03:22 AM


If the issue is solved, don't forget to mark the thread as solved. That will help people with similar query later.

(comments are locked)
10|2000 characters needed characters left

Hey, this is by no means the best way but from what I understood this works for what you're trying to do

alt text

I'll explain it :

Step 1 : Go to your "Project Settings", Edit>Project Settings, click on the "Input" tab under "Engine" and add two Action Mappings, Call them what ever you want, in this case I called them Mouse1Forward & Mouse2Forward, set them to your right and left mouse buttons.

Step 2 : Go to your "Character" Blueprint and add two "Boolean" variables defaulted to False, I called mine Can Move M1 & Can Move M2.

Step 3 : Copy the blueprints shown in the picture into your "Character" blueprint, hit compile and save.

^ This should work.

Brief explanation(For education) :

I have it set so that when I press My Left Or Right mouse button it sets a boolean to true or false then EventTick will tick the execution every frame, meaning the Branch node will ask if both Boolean variables where set to True, if they are then move forward.

Hope this helps.

mouse forward.png (526.2 kB)
more ▼

answered Oct 06 '14 at 05:00 AM

avatar image

121 13 18 24

(comments are locked)
10|2000 characters needed characters left


I see where your getting at with this never thought of it that way... Hmmm however does it work if you just press left or right on there own and still moves or does it only move forward if you have both pressed?

more ▼

answered Oct 06 '14 at 07:56 AM

avatar image

6 1 3 6

avatar image TheMunky Oct 06 '14 at 03:08 PM

I don't understand the question, what exactly are you trying to make? I need a rough Idea to understand.

Do you mean, when the left button is held, move left and when the right button is held move right but hold them both and you move forward?

avatar image Jyoji Oct 06 '14 at 03:25 PM

Ok, so what I want to do is make it so aswell as my standard forward moment input I would like it so when the condition of mouse buttons left and right are clicked together that it also moves the character forward.

I know it's something basic and simple but it's been driving me up the wall trying to figure it out, however I will try both of the solutions I've been given by your guys and see what works and if I can work with what I've been given a bit further.

(comments are locked)
10|2000 characters needed characters left
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