Input.GetAxis going crazy when I click outside the game window
Hello, I'm new to Unity, so I'm sorry if I am missing something very obvious here....
I move my main "free" camera transform with my Logitech controller like this in the update: var rotateCamera = new Vector2(Input.GetAxis("Pan"), Input.GetAxis("Tilt") * (invertY ? 1 : -1));
and then I use these values to change the camera's X and Y euler angles. I wired my joystick using the project settings like this:
"Pan" gravity 0 dead 0.05 sensitivity 1 type "joystick axis" axis "4th axis" joy num "get motion from all axis"
All the rest is left blank.
I also need to consider mouse clicks from the user on UI buttons. I left this to be managed by the auto generated EventSystem obj, with its standalone input etc.. I did not touch any of these settings or any of the defaults Horizontal, Vertical cancel and submit...
I also have multiple cameras (3), but only one has the script above...
The problem I get is the main "free" camera starts to fly around on its own randomly when I switch to another screen or click somewhere else that is not the screen or the UI. And it only stops if I repeatedly switch again or press the windows start button... for example @o@
Any help would be much appreciated! Thanks
Your answer
Follow this Question
Related Questions
How can I use both mouse and keyboard to do the same thing? [SOLVED] 1 Answer
Why is my MouseLook script not letting me look up? 0 Answers
Limited response from mouse input in game view. 2019.3 0 Answers
Detect player movement 0 Answers
Unity 3D: Third person movement and mouse camera control 0 Answers