My character sticks when jumping on walls

Screenshot_846

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

public class movement : MonoBehaviour
{

    public float speed = 8f;
    public float jump = 16f;
    private float horizontal;
    private bool isjumping;
    


    public Rigidbody2D rb;


    // Start is called before the first frame update
    void Start()
    {


        

    }

    // Update is called once per frame
    void Update()
    {


        horizontal = Input.GetAxis("Horizontal");

        rb.velocity = new Vector2(speed * horizontal, rb.velocity.y);

        if (Input.GetKeyDown(KeyCode.W) && isjumping == false)
        {

            rb.AddForce(new Vector2(rb.velocity.x, jump));

        }


    }



    private void OnCollisionEnter2D(Collision2D other)
    {

        if (other.gameObject.CompareTag("ground"))
        {

            isjumping = false;


        }


    }



    private void OnCollisionExit2D(Collision2D other)
    {

        if (other.gameObject.CompareTag("ground"))
        {

            isjumping = true;


        }


    }









}

My character has a box collider on the ground, a circle collider and a rigidbody while the ground has a box collider.

The wall on the other hand has just a box collider but when my character rushes into the wall while jumping or jumping when next to the wall it sticks to the wall. How can I fix it?

You should make a Physics Material 2D by clicking: (Right Click) > Create > 2D > Physics Material 2D, name it whatever you want, set the Friction to 0, and add it to your Player’s Collider as the Material. This will make it so the Collision has no friction and slides in the wall. Hope this helps, and if this doesn’t work, I will be more than happy to assist you.