Show mouse cursor bug


If i use this script,but UI loses focus after release LMB.

This script works fine but not hide cursor.

How fix this?

First of all: Why using an Axis for a Button? Try to create an Action Mapping instead of Axis. Then you get a Pressed and Released exec instead of an Axis Value.

Second: Maybe you want to use “Set Input Mode Game and UI” when releasing the mouse button and displaying the mouse.

1)I rotate my camera by using this script.
2) If i remove “Input mode” node nothing changes


add print string node
[video]- YouTube
short video with my problem

  1. That doesn’t answer my question :smiley:

Input Axis are for something that has a value from -1 to 1. For example the mouse movement on X or Y (-1 down, 1 up, 0 still standing) or a stick of a controller.
But a button press should just be an Action Mapping. Go to the Project Settings -> Inputs and create an Action Mapping instead of an Axis Mapping. Then you don’t
need to check the axis value being equal to 1, because you will have a pressed and a released exec!

  1. I never said to remove the input mode. I said you should ADD “Set Input Mode Game and UI” to the FALSE exec. :smiley: Please read exactly what i write, otherwise
    i can’t help you.

After some tests i created this script and it started work)) I think it is not perfect and if some one have tip how make its better i will be glad to hear it.

P.S. Still dont understand why without show mouse cursor my first script works and with it dont work. Someone can explain this?

eXi, thank you so much!! You my hero:D

I guess that’s something happening through the “Set Input Mode Game Only”. I don’t know what exactly this thing does, but imagine it like setting the UI Mode to something that might not want to use the cursor.
A shooter for example where you don’t need the cursor while playing. If you want to have the full working UI and cursor back, you need to change the UI mode to something else (like you now do).