How do I make 8 way 2d grid based movement

Im very new to game development (Literally been doing it for four or so weeks)

I’m trying to make a mystery dungeon style game and I need 8 way movement. It technically works but it’s extremely hard to press two keys at once and move diagonally. The up/down and left/right movement works perfectly though. I have no idea how to approach this issue so I am asking for help with it.

Here’s the scripts relating to movement, created by amalgamating three different tutorials. TLDR for the code(I’m not that good at explaining things so if something doesn’t make sense sorry : [ ): There’s a script that has a dictionary that sets a “world tile” to each tile in a tilemap labled floor. The character occupies one of the world tiles and the method to get a character to occupy one of the world tiles, SetUnit, sets the transform to the center of that tile. The MoveableThing script has a move method that gets the current position of the tile it’s occupying and adds the input direction to it (I’m currently using the old input system but I know how the new one works I just used that first) in the form of a Vector3, then another method, CanMove, checks the dictionary of world tiles to see if that tile is movable or even exists, if yes to both of those it returns true. If canmove is true then the move method gets the tile that is trying to be moved to to set the unit to be the character trying to move onto that tile.

public class World_Tile
{
    public enum TileType
    {
        Floor,
        Water,
        Lava,
        Wall
    }
    public Vector3Int LocalPlace { get; set; }
    public Vector3 WorldLocation { get; set; }
    public Vector3 Center { get; set; }
    public Tilemap TilemapMember { get; set; }
    public TileBase TileBase { get; set; }
    public TileType tileType { get; set; }

    public MoveableThing occupiedUnit;
    public bool walkableFloor => tileType == TileType.Floor && occupiedUnit == null;
    public void SetUnit(MoveableThing character)
    {
        if (character.occupiedTile != null) character.occupiedTile.occupiedUnit = null;
        character.transform.position = this.Center;
        this.occupiedUnit = character;
        character.occupiedTile = this;
    }

}
public class MoveableThing : MonoBehaviour
{
    public World_Tile occupiedTile;
    protected Dictionary<Vector3, World_Tile> _tiles;
    protected virtual void Start()
    {
        _tiles = MakeTheTIilesHaveData.tInstance.tiles;
    }
    protected virtual void Move(Vector2 direction)
    {
        Vector3 movePosition = occupiedTile.WorldLocation + (Vector3)direction;
        World_Tile tileToMoveTo = _tiles[movePosition];
        if (CanMove(tileToMoveTo))
            tileToMoveTo.SetUnit(this);
            
    }
    protected bool CanMove(World_Tile tileToMoveTo)
    {
        if (!tileToMoveTo.walkableFloor || tileToMoveTo == null)
            return false;
        return true;
    }
}
public class PlayerMovement : MoveableThing
{
    public Transform playerSprite;
    public float moveSpeed = 5f;
    float time = 1f;
    protected override void Start()
    {
        base.Start();
        playerSprite.transform.parent = null;
    }
    private void Update()
    {
        if (time > 0f)
        {
            time -= Time.deltaTime;
        }
        if (Vector3.Distance(playerSprite.position, transform.position) <= .0f)
        {
            Vector2 direction = new Vector2();
            if (Mathf.Abs(Input.GetAxisRaw("Horizontal")) == 1f & Mathf.Abs(Input.GetAxisRaw("Vertical")) == 1f && time <= 0)
            {
                direction = new Vector2(Input.GetAxisRaw("Horizontal"), Input.GetAxisRaw("Vertical"));
                time = .5f;
            }
            else if (Mathf.Abs(Input.GetAxisRaw("Horizontal")) == 1f && time <= 0)
            {
                direction = new Vector2(Input.GetAxisRaw("Horizontal"), 0);
                time = .5f;
            }
            else if (Mathf.Abs(Input.GetAxisRaw("Vertical")) == 1f && time <= 0)
            {
                direction = new Vector2(0, Input.GetAxisRaw("Vertical"));
                time = .5f;
            }

            Move(direction);
        }
        playerSprite.transform.position = Vector3.MoveTowards(playerSprite.position, transform.position, moveSpeed * Time.deltaTime);
    }
}

Fixed my own issue! The key was switching to the new input system and adding a bunch of if statements for each of the .7 input values basically

public class PlayerMovement : MoveableThing
{
    public InputActionReference movement;
    public Transform playerSprite;
    public float moveSpeed = 5f;
    float time = 1f;
    protected override void Start()
    {
        base.Start();
        playerSprite.transform.parent = null;
    }
    private void Update()
    {
        if (time > 0f)
        {
            time -= Time.deltaTime;
        }
        if (Vector3.Distance(playerSprite.position, transform.position) <= .0f && time <= 0f)
        {
            Vector2 direction = movement.action.ReadValue<Vector2>();
            if (direction.x >= .7f && direction.y >=.7f)
            {
                direction = new Vector2(1, 1);
            }
            if (direction.x <= -.7f && direction.y >= .7f)
            {
                direction = new Vector2(-1, 1);
            }
            if (direction.x <= -.7f && direction.y <= -.7f)
            {
                direction = new Vector2(-1, -1);
            }
            if (direction.x >= .7f && direction.y <= -.7f)
            {
                direction = new Vector2(1, -1);
            }
            Move(direction);
            time = .5f;
        }
        playerSprite.transform.position = Move_Towards.SmoothMoveTo(playerSprite.transform.position, transform.position);
    }

}