Setting Mouse Buttons As Movement
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!
asked Oct 06 '14 at 04:30 AM in Blueprint Scripting
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.
answered Oct 06 '14 at 08:01 AM
Hey, this is by no means the best way but from what I understood this works for what you're trying to do
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.
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?
answered Oct 06 '14 at 07:56 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here