Hi again
,
The problem is controller joystick is not delta timed. For example:
- If your stick on the right at 10 fps it will be updated 10 * 1 per seconds = 10 units.
- With the stick on the right at 100 fps it will be updated 100 * 1 per seconds = 100 units.
Why doesn’t it happen with the mouse?
If you are at 10 fps or 100 fps moving physically the mouse 100 inch to the right the delta per frame will change but the total delta per second will be the same.
How to solve it?
We will see with the team if there is a way to improve this use case in a better way. The frame based joystick value makes sense in some use case and doesn’t in others.
In your case specifically you could use processors to make the joystick value delta timed. Simplest way would be to create a processor.
using UnityEngine;
using UnityEngine.InputSystem;
#if UNITY_EDITOR
using UnityEditor;
[InitializeOnLoad]
#endif
public class DeltaTimeProcessor : InputProcessor<Vector2>
{
#if UNITY_EDITOR
static DeltaTimeProcessor()
{
Initialize();
}
#endif
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
static void Initialize()
{
InputSystem.RegisterProcessor<DeltaTimeProcessor>();
}
public override Vector2 Process(Vector2 value, InputControl control)
{
return value * Time.deltaTime;
}
}
And add this processor to your joystick action.
Let us know if this work for you.
