[Imrovement] Scale Input System's mouse delta x and y to the same size as the classic Input system.

echtnice

Member
Hi,

while playing with the new input system integration, i noticed that mouse movement was a lot faster than with the old input system.
I found the following post and the author of this post scaled the delta values to more closley match the values from the old input system.

From https://forum.unity.com/threads/mouse-delta-input.646606/#post-5043518
Code:
var delta = m_Action.ReadValue<Vector2>();
 
// Account for scaling applied directly in Windows code by old input system.
delta *= 0.5f;
 
// Account for sensitivity setting on old Mouse X and Y axes.
delta *= 0.1f;

I used these values to scale my delta and I now get the same mouse movement speed as with the classic Input system by default. I wonder if your wanna apply these scale values to your integration by default? I think i would be less surprising in the case the user did not tune the classic input values (which should be the case for most people i think)

Thanks!

Code:
diff --git a/Assets/Opsive/UltimateCharacterController/Integrations/InputSystem/CharacterInput.cs b/Assets/Opsive/UltimateCharacterController/Integrations/InputSystem/CharacterInput.cs
index 92610760..7bdde618 100644
--- a/Assets/Opsive/UltimateCharacterController/Integrations/InputSystem/CharacterInput.cs
+++ b/Assets/Opsive/UltimateCharacterController/Integrations/InputSystem/CharacterInput.cs
@@ -438,7 +438,7 @@ public class @CharacterInput : IInputActionCollection, IDisposable
                     ""id"": ""a33b125b-e60e-43c0-94d9-3279d2cd6331"",
                     ""path"": ""<Mouse>/delta/x"",
                     ""interactions"": """",
-                    ""processors"": """",
+                    ""processors"": ""Scale(factor=0.05)"",
                     ""groups"": ""Keyboard"",
                     ""action"": ""Mouse X"",
                     ""isComposite"": false,
@@ -471,7 +471,7 @@ public class @CharacterInput : IInputActionCollection, IDisposable
                     ""id"": ""6ca55954-ea77-4fbd-8266-bf1e6d3d6ea5"",
                     ""path"": ""<Mouse>/delta/y"",
                     ""interactions"": """",
-                    ""processors"": """",
+                    ""processors"": ""Scale(factor=0.05)"",
                     ""groups"": ""Keyboard"",
                     ""action"": ""Mouse Y"",
                     ""isComposite"": false,
diff --git a/Assets/Opsive/UltimateCharacterController/Integrations/InputSystem/CharacterInput.inputactions b/Assets/Opsive/UltimateCharacterController/Integrations/InputSystem/CharacterInput.inputactions
index bee5d47d..66b5d599 100644
--- a/Assets/Opsive/UltimateCharacterController/Integrations/InputSystem/CharacterInput.inputactions
+++ b/Assets/Opsive/UltimateCharacterController/Integrations/InputSystem/CharacterInput.inputactions
@@ -425,7 +425,7 @@
                     "id": "a33b125b-e60e-43c0-94d9-3279d2cd6331",
                     "path": "<Mouse>/delta/x",
                     "interactions": "",
-                    "processors": "",
+                    "processors": "Scale(factor=0.05)",
                     "groups": "Keyboard",
                     "action": "Mouse X",
                     "isComposite": false,
@@ -458,7 +458,7 @@
                     "id": "6ca55954-ea77-4fbd-8266-bf1e6d3d6ea5",
                     "path": "<Mouse>/delta/y",
                     "interactions": "",
-                    "processors": "",
+                    "processors": "Scale(factor=0.05)",
                     "groups": "Keyboard",
                     "action": "Mouse Y",
                     "isComposite": false,
 
Right Stick X / Y for GamePad needs the same changes

var delta = m_Action.ReadValue<Vector2>();
// Account for scaling applied directly in Windows code by old input system.
delta *= 0.5f;
// Account for sensitivity setting on old Mouse X and Y axes.
delta *= 0.1f;

delta * = 30f ==> 1.5f

Code:
@ -427,7 +427,7 @@ public class @CharacterInput : IInputActionCollection, IDisposable
                    ""id"": ""4e2dc872-baff-4fcd-8178-0a104c89b955"",
                    ""path"": ""<Gamepad>/rightStick/x"",
                    ""interactions"": """",
-                    ""processors"": ""AxisDeadzone,Scale(factor=30)"",
+                    ""processors"": ""AxisDeadzone,Scale(factor=1.5)"",
                    ""groups"": ""Gamepad"",
                    ""action"": ""Mouse X"",
                    ""isComposite"": false,
@ -460,7 +460,7 @@ public class @CharacterInput : IInputActionCollection, IDisposable
                    ""id"": ""a276958e-275d-4e1b-a12d-04aac1cd5dab"",
                    ""path"": ""<Gamepad>/rightStick/y"",
                    ""interactions"": """",
-                    ""processors"": ""AxisDeadzone,Scale(factor=30)"",
+                    ""processors"": ""AxisDeadzone,Scale(factor=1.5)"",
                    ""groups"": ""Gamepad"",
                    ""action"": ""Mouse Y"",
                    ""isComposite"": false,
 
Top