How to make floor slippery without physics material?

Hello,
I a beginner to Unity and coding so sorry if I missed something obvious.

I am trying to remove friction from a platform to make a character “glide”.

I’ve tried using Physics Materials but it makes no difference, even lowering the Friction to 0. So I am trying to find a way to make the floor “icy” through code.
I am struggling to figure out how because all I can find is suggestions saying use the Physics Material.

Here is my code:

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

public class characterscript : MonoBehaviour
{
    public Rigidbody2D myRigidBody;
    public float jumpstrength;
    public float speed;

    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Space) == true)
        {
            myRigidBody.velocity = Vector2.up * jumpstrength;
        }

        if (Input.GetKey(KeyCode.LeftArrow))
        {
            var move = new Vector3(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"), 0);
            transform.position += move * speed * Time.deltaTime;
        }

        if (Input.GetKey(KeyCode.RightArrow))
        {
            var move = new Vector3(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"), 0);
            transform.position += move * speed * Time.deltaTime;
        }
    }

}

If you want more information from me please ask.

Physics material cannot help you, because you are moving the transform position directly. That will actually break any physics interactions with your character, so you should at least use forces / add velocity to control your character.
To make the floor slippery, you could

  • Detect, what kind of surface you are standing on, use the obtained value to decelerate your character by code. Since you are currently not even accelerating or using rigidbody velocity, friction doesn’t make sense at all. If you rewrite your code to use velocity, accelerating on input and decelerating on no input, you could determine the deceleration rate from the collider you are standing on, even from its physics material if you choose to o.
  • Use some kind of invisible wheel. That would give you the most realistic physical interaction with the environment, eg. applying a reaction force to an object you are standing on. Your code would simply control the motor of that wheel to induce physical movement.

Thank you.
I will try to use velocity