x

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"

Have to double click when cursor is shown

Hello, I'm learning UE4 by reading/watching tutorials. Right now, i'm working this tutorial series : Twin Stick Shooter

Everything works just fine, but i'd like to go a little further. My goal is to modify the controller to be able to move with the keyboard and rotate/fire with the mouse. I could manage it, but i have one last problem.

What i want to achieve :

  1. move with the keyboard (OK : was already like that in the tutorial)

  2. aim with the mouse (OK : i used RayPlane Intersection Point, maybe there's much better, but it works)

  3. shoot the weapon when i click the left mouse button (buggy)

  4. stop shooting when i release the left mouse button (OK)

  5. show a crosshair (buggy)

So, what is the problem : when i enable the crosshair (show the mouse cursor), i have to double click (and hold but that's what i want) to fire the weapon, when i do not show the crosshair, weapon firing is working just as expected.

So, what i've done :

In my project settings, i added an action mapping called "Fire", and mapped it to the left mouse button.

I created a new blueprint extending the PlayerController blueprint named MouseController and then taught the game mode blueprint (the one frome the tutorial : TwinStickMode) to use that controller by default.

And that's all, when i leave the "Show Mouse Cursor" property unticked in my MouseController blueprint's class defaults, everything works as expected, but i don't see my crosshair, but when i turn the property on, i see my crosshair as expected, but i have to double click to fire the weapon.

I added some debugging nodes to my HeroCharacter blueprint to understand what happens here :

Debug blueprint

Now i can say that the Fire event gets called correctly when my mouse cursor is hidden (PRESS and RELEASE strings get displayed correctly), but when my mouse cursor is shown, the event doesn't get called as i want, i have only one RELEASE string for a single click and i have two RELEASE strings and one PRESS string for a double click.

I've seen many questions about mouse problems, but couldn't find anything similar enough to help me out, so any idea would be apprectiated.

Thanks for your time.

Product Version: UE 4.14
Tags:
screen.png (100.0 kB)
more ▼

asked Dec 24 '16 at 02:44 PM in Blueprint Scripting

avatar image

atom.42
6 1

avatar image urreek Nov 20 '17 at 04:56 AM

Try setting InputDataGameOnly , and set SetConsumeCaptureMouseDown to false on the InputData.

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

0 answers: sort voted first
Be the first one to answer this question
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