Analog Stick Snapping

Hey there, I’m working on a topdown 2D game that requires smooth analog stick movement. I couldn’t do anything about the deadzones, though. The values of the axis snap to 1, -1, or specific numbers when near 45esque’s angles. Already stored 0 on dead zone on the Input Manager, tried code for radial deadzone (did everything this page had to say Casino software guide everything you need to know - Third Helix) and changed joysticks. I’m currenly using a generic. Any ideas would be very much welcome.

I posted this a few days ago for someone [here][1], it may help you. You could tighten up the regions;

 using System;
 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 
 public enum StickRegion
 {
     Centre,
     Top,
     TopLeft,
     TopRight,
     MiddleLeft,
     MiddleRight,
     BottomLeft,
     BottomRight,
     Bottom
 }
 
 public class InputRegion : MonoBehaviour
 {
     public List<Sequence> sequences = new List<Sequence>();
 
     private StickRegion _currentRegion;
     private StickRegion _lastRegion;
 
     public void Update()
     {
         var stickpos = new Vector2(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"));
 
         _currentRegion = GetStickRegion(stickpos);
 
         if(_currentRegion != _lastRegion)
         {
             Debug.Log(_currentRegion);
             _lastRegion = _currentRegion;
 
             CheckSequences(_currentRegion);
         }
     }
 
     private void CheckSequences(StickRegion region)
     {
         for(var i = 0; i < sequences.Count; i++)
         {
             //If the new region matechs the next region in the sequence
             if(region == sequences_.sequence[sequences*.currentIndex])*_

{
//Advanve our index by one
sequences*.currentIndex++;*

//Count has reached the end of the sequence so all inputs matched
if(sequences_.currentIndex > sequences*.sequence.Count - 1)
{
//Do something when that combo has been performed*

Debug.Log(“Combo " + i.ToString() + " Success”);
//Reset the index back to 0 ready for it to fire again
sequences*.currentIndex = 0;*
}
continue;
}
//The inputs did not match the sequence somewhere so we reset it back to the start
sequences*.currentIndex = 0;*
}
}_

public StickRegion GetStickRegion(Vector2 stickPos)
{
if (Mathf.Abs(stickPos.x) < 0.3f && Mathf.Abs(stickPos.y) < 0.3f)
return StickRegion.Centre;

if(Mathf.Abs(stickPos.x) < 0.3f)
{
if (stickPos.y > 0.3f)
return StickRegion.Top;
if (stickPos.y < -0.3f)
return StickRegion.Bottom;
}

if(stickPos.x > 0.3f)
{
if (Mathf.Abs(stickPos.y) < 0.3f)
return StickRegion.MiddleRight;

if (stickPos.y > 0.3f)
return StickRegion.TopRight;
if (stickPos.y < -0.3f)
return StickRegion.BottomRight;
}

if(stickPos.x < -0.3f)
{
if (Mathf.Abs(stickPos.y) < 0.3f)
return StickRegion.MiddleLeft;

if (stickPos.y > 0.3f)
return StickRegion.TopLeft;
if (stickPos.y < -0.3f)
return StickRegion.BottomLeft;
}

return StickRegion.Centre;
}
}

[Serializable]
public class Sequence
{
public List sequence;
public int currentIndex;
}
_*[1]: https://answers.unity.com/questions/1614808/arcade-stick-input-commands-implementation.html?childToView=1614837#answer-1614837*_