I have placed in my level a cube, which is my player, and a camera, which will follow the player.
I'm defining a direction A from camera to player and another B perpendicular to this one. So I get two perpendicular directions no matter where the camera is located, A and B.
So far so good. I'm multiplying the direction A by the value of the vertical axis of a PS4 joystick. And the B direction by the horizontal input.
Then I make a vector sum:
C = (A * verticalInput) + (B * horizontalInput)
C faces the direction in which the player should face, regardless of the camera position, so I can move the camera anywhere and the joystick input always corresponds to the camera's view.
The issue is that when the input magnitude is very very small, the C vector oscillates rapidly in a small angle interval. The result is that the player "vibrates" when looking at that direction.
This effect disappears when the inputs are greater than 0.5, but I cannot use a value that large for a dead zone because I want my player to walk very slowly because he is a ninja! (And is about to make a stealth-kill or very slow movement to avoid noise).
In other words, how do I reduce the jitter from noisy joystick input?