Object is not moving after collision

I have player and walls. When the player hits the wall, its not moving.

Those are codes for moving :

void MoveTileBased()
{
    transform.position = Vector3.MoveTowards(transform.position, destination, Time.deltaTime * speed);
    









    if (Input.GetKeyDown(KeyCode.W))
    {
        nextPos = Vector3.forward;
    }

    if (Input.GetKeyDown(KeyCode.S))
    {
        nextPos = Vector3.back;
    }

    if (Input.GetKeyDown(KeyCode.A))
    {
        nextPos = Vector3.left;
    }

    if (Input.GetKeyDown(KeyCode.D))
    {
        nextPos = Vector3.right;
    }


    if(Vector3.Distance(destination, transform.position) < 0.01f)
    {
        destination = transform.position + nextPos;
    }
}

This is collision script :

private void OnCollisionEnter(Collision collision)
{

    player.speed = 0f;

}

Walls collider

Player rigidbody and collider

Don’t set your speed to 0 when you hit a wall. If your speed is 0 then you have no way to get off of the wall. It looks like you are using that code to keep you from going through the wall, but really you should probably be relying on the physics system to do that for you. Use a PlayerController component or the rigidbody move function to move your character instead. These will automatically stop you if you try to move into a wall. Moving directly via the transform however will send you straight through walls.

Actually ı know why player not moving but I couldn’t find a way to get around it. The reason I created this collision script is player is vibrting after hits the wall. If you have any other solution not to vibrate after collision it would be fine @bdubbert