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"

Some 'Pressed'-Events are omitted in 'Input Mode Game Only'

Hi there,

I want to start an action when I press my Left Mouse Button and stop the action as soon as I release the Left Mouse Button.

So here is what I did:


alt text


alt text


alt text


alt text

As you can see in the result, there are more 'Released'-Events than 'Pressed'-Events. The amount of 'Released'-Events is the amount of actual clicks.

I guess the main reason for this to happen is, that I set 'Show Mouse Cursor' to true while being in the 'GameMode only' mode.

So the question is: Why are some pressed events omiited?

My actual goal is to fire my weapon on the 'Pressed'-Event and stop firing the weapon on the 'Released-Event'. In addition my UI should still be seen, but should not be able to interact with. However I need my Mouse Cursor to be seen, since the Cursor is an indicator for my player in which direction he is moving.

The issue is that as soon as I show my Mouse Cursor I am able to interact with my UI.

Can I somehow also prevent my Cursor from interacting with my UI?

I mean I could also position a widget to my mouse position in a tick event. However I also read that this could feel kind of laggy and hardware pointers (or those which you can set in Project Settings -> User Interface) are preferred.

Thanks a bunch :)

Product Version: UE 4.12
gamemode.png (17.1 kB)
pawn.png (48.2 kB)
output.png (523.6 kB)
more ▼

asked Aug 24 '16 at 03:27 PM in Blueprint Scripting

avatar image

67 6 9 15

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

1 answer: sort voted first

Interesting that there's exactly two releases for each press.

Yes, you can prevent the mouse from interacting with the world by calling the "Set Input Mode UIOnly" node from within a widget.

more ▼

answered Aug 24 '16 at 08:28 PM

avatar image

2.1k 67 84 77

avatar image smara Aug 25 '16 at 06:12 AM

The amount of 'Pressed'-Events depend of the intervals between my mouse clicks.

If I have an interval of 1 sec between my clicks, then you will see no 'Pressed'-Event at all. Only if I spam my clicks some 'Pressed'-Events pop up occasionally.

alt text

If I understand right, the 'Set Input Mode UIOnly' would block all inputs which I receive in my Pawn or PlayerController.

In my case, I want to have control over my Pawn/PlayerController and thus (GameMode only), but I also have to show my mouse cursor since its an indicator in which direction my player travels or if he currently shoots or not.

Some widgets should be visible (like healthbars and so on) while those who contain buttons should not be clickable in this state.

I guess I could use Input Mode GameMode + UI and then always check on ButtonClicks if I am allowed to execute that button, which I wanted to prevent since this would generate a lot of redundant code and would be really annoying to service such code of a longer period of time.

more_output.png (696.9 kB)
(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