Ice / Slippery Physic for Grid Movement

Hi ! I’m new to all of this and until now I’ve only helped myself with already existing topics on this forum.
I’ve been trying Unity without any knowledge of C# or any programmation language overall.

Anyway i’ve started trying, as a first “personnal” (with no full tutorial) project, to do a puzzle-game based on Ice in topdown, so first of all i’ve looked up for a way to do a grid movement (an artificial one with Vector.up/down/left/right, i haven’t found anything about an actual grid system to snap objects)
It works kinda fine, I managed to place colliders at the four extremities of my character to avoid them from moving when an obstacle (ontriggerstay2d + layermask) is detected, and so I decided for the Ice to make a similar system as I can’t tweak with physics (the player’s movement is artificial and doesn’t add any velocity to rb)

I’m sure it’s not optimized so well but for a tiny pixelated experimental mobile game it shouldn’t be an issue, but… when my character goes on a sprite or a tilemap layered “Ice” it’s not having the expected reaction, it’s all buggy and the bool i made to see if the player is “on ice” is kind of… blinking??

anyway sorry for the super long explainations, here’s my script (sorry if it burns your eyes i’m rly new to this)

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerMovement : MonoBehaviour
{

    public float speed = 2.0f;

    // getting the bool for each ones of my colliders (child empties under my player)
    public detectLeft colLeft;
    public detectRight colRight;
    public detectUp colUp;
    public detectDown colDown;

    // i tried making the collider a child, thinking it may be glitching [..]
    // [..] because it's taking the whole parent group (with the obstacle colliders placed on the exterior)
    public detectIce colIce;

    public Animator animator;

    public int lastMove;
    //public bool isOnIce;

    // differenciating the two vectors so i can switch whenever i 
    Vector3 pos;
    Vector3 icepos;

    void Start()
    {
        pos = transform.position;
        icepos = transform.position;
    }

    void Update()
    {
        //complicated but only way i found for grid movement definition
        if (Input.GetKeyDown(KeyCode.D) && transform.position == pos && !colRight.detect)
        {
            pos += Vector3.right;
            animator.SetTrigger("Right");
            lastMove = 1;
        }
        else if (Input.GetKeyDown(KeyCode.Q) && transform.position == pos && !colLeft.detect)
        {
            pos += Vector3.left;
            animator.SetTrigger("Left");
            lastMove = 2;
        }
        else if (Input.GetKeyDown(KeyCode.Z) && transform.position == pos && !colUp.detect)
        {
            pos += Vector3.up;
            animator.SetTrigger("Up");
            lastMove = 3;
        }
        else if (Input.GetKeyDown(KeyCode.S) && transform.position == pos && !colDown.detect)
        {
            pos += Vector3.down;
            animator.SetTrigger("Down");
            lastMove = 4;
        }



        //lastmove -> 1 = right, 2 = left, etc... (replace after each "standard ground" movement)
        if (lastMove == 1) 
        {
            icepos += Vector3.right;
        }
        if (lastMove == 2)
        {
            icepos += Vector3.left;
        }
        if (lastMove == 3)
        {
            icepos += Vector3.up;
        }
        if (lastMove == 4)
        {
            icepos += Vector3.down;
        }

        //for normal movement
        if (!colIce.detect)
        {
            transform.position = Vector3.MoveTowards(transform.position, pos, Time.deltaTime * speed);
        }

        //for ice movement
        if(colIce.detect)
        {
            transform.position = Vector3.MoveTowards(transform.position, icepos, Time.deltaTime * speed);
        }

        
    }
}

also for every separate collider it’s a simple script of just :

public bool detect = false;

    void OnTriggerStay2D(Collider2D collision)
    {
        if (collision.gameObject.layer == LayerMask.NameToLayer("Ice"))
        {
            detect = true;
        }
    }

    void OnTriggerExit2D(Collider2D collision)
    {
        if (collision.gameObject.layer == LayerMask.NameToLayer("Ice"))
        {
            detect = false;
        }
    }

just so i can get the booleans in my movement script

precision about the glitch btw (i should’ve done that in the main post) : it works just fine when entering ice tiles but it’s at the exit it’s stuck in between the ice and normal ground)