I seem to be having issues with analog joystick rotation.
It weirdly snaps to diagonal rotations and I cannot for the life of me fix this.
// Get input
inputVector.X = Input.GetAxisRaw("MoveX");
inputVector.Y = Input.GetAxisRaw("MoveY");
// Calculate input direction
inputDir = new Vector3(inputVector.X, 0, inputVector.Y)Normalized;
Dir = Camera.Transform.TransformDirection(inputDir);
Quaternion targetOrientation = Quaternion.LookRotation(Dir, Camera.Transform.Up);
ForwardArrow.Orientation = Quaternion.Slerp(ForwardArrow.Orientation, targetOrientation, rotationSpeed * Time.DeltaTime);
(few of the names have been changed for more clarity)
I have tried every code I could find. When reading the debug log its as if when pressing towards diagonals the input jumps to beyond its maximum. Any help appreciated.