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"

Input for left mouse click not always working

Hello, I have a game that implements the left mouse button click as a firing event. While the button is pressed, it should continue to fire projectiles until it is released. Then, when the player looses all hitpoints, a death animation plays and a "Game Over" menu pops up with options to restart the game or quit the level.

It's when I restart the game that the issue starts. I can hold down the left mouse button and fire after restarting the game, but if I let go of it and then try to press and hold it again, it doesn't work. I noticed I can only get the "gate" to open if I double click with the left mouse button and hold. Does anyone have any suggestions as to why this is happening and how to address it?

Attached are my blueprints for the Firing event in my player pawn and controller class, and my restart button for the menu.

Pawn Class alt text

Controller class alt text

Game Over Menu alt text

Product Version: UE 4.14
more ▼

asked Dec 25 '16 at 06:34 PM in Blueprint Scripting

avatar image

1 2 3 4

avatar image Pariah013 Jan 02 '17 at 08:45 AM

I've encountered a similar issue when regaining control of the mouse. Try adding a SetFocusToGameViewport node after changing the input type. Cheers!

avatar image Guitardude1354 Jan 05 '17 at 03:13 AM

Thank you for the advice. I think I found a different solution by following this tutorial on paused and main menus: https://www.youtube.com/watch?v=T1huRlQBZlQ

From what I could find, the issue had to do with a part of my level blueprint where I was switching the input control to the menu only and the Set Show Mouse Cursor was somehow interfering with the input when I selected restart. I was able to get it working by using the following in my level blueprint: alt text

And removing the Set Show Mouse Cursor and Set Input Mode Game Only from the Game Over Menu (from my original post)

avatar image Guitardude1354 Jan 05 '17 at 03:17 AM

I should also state I had to add the following to my Player Controller class to make sure the input is set correctlyalt text

(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