Tom
Tom

Reputation: 2873

Unity3D New Input System - How to configure sensitivity of mouse ONLY on a composite binding?

In my game, you can move the camera either by using WASD or by holding a mouse button and moving the mouse. Similar for rotation and zoom - they all have both keyboard and mouse controls.

That's easy enough to set up in the new input system. I have set up three actions (move, rotate, zoom) and given them both mouse and keyboard bindings.

However, I'd like to configure sensitivity of the mouse. People have set their mice up differently. I know how to add a processor to the mouse binding to give mouse and keyboard different sensitivities using a scale processor.

I can't figure out how to access that processor in code to change it based on a player configuration option. I want to change ONLY the mouse scale processor, NOT the keyboard one - keyboard is just 1/0 so it's the same for everyone, but mice are configured differently and I want players to set their own MOUSE sensitivity.

I've read the documentation, various tutorials, the closest I found was this, but it refers to the whole action, not an individual binding: https://gamedevbeginner.com/input-in-unity-made-easy-complete-guide-to-the-new-system/#ineractions_and_processors

Upvotes: 2

Views: 5541

Answers (1)

Tom
Tom

Reputation: 2873

Someone on the Unity forum pointed me in the right direction and posted a working solution that I could adapt to work for me:

https://forum.unity.com/threads/how-do-i-configure-sensitivity-of-mouse-and-keyboard-individually-on-the-same-action.1221417/

Upvotes: 1

Related Questions